1. Go to this page and download the library: Download nash81/bsicards-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nash81 / bsicards-php-sdk example snippets
use BSICards\BSICardsClient;
use BSICards\APIException;
// Initialize client (credentials from .env)
$client = new BSICardsClient();
try {
// Create a MasterCard
$response = $client->mastercardCreateCard(
'[email protected]',
'John Doe',
'1234'
);
echo "Card created: " . $response['message'];
} catch (APIException $e) {
echo "Error: " . $e->getMessage();
}
use BSICards\BSICardsClient;
class CardController extends Controller
{
public function createCard(BSICardsClient $client)
{
$response = $client->mastercardCreateCard(
request('email'),
request('name'),
request('pin')
);
return response()->json($response);
}
}
// Create a new MasterCard
$client->mastercardCreateCard($email, $name, $pin);
// Get all MasterCards
$client->mastercardGetAllCards($email);
// Get pending MasterCards
$client->mastercardGetPendingCards($email);
// Get specific card details
$client->mastercardGetCard($email, $cardId);
// Get card transactions
$client->mastercardGetTransactions($email, $cardId);
// Change card PIN
$client->mastercardChangePin($email, $cardId, $newPin);
// Freeze card
$client->mastercardFreezeCard($email, $cardId);
// Unfreeze card
$client->mastercardUnfreezeCard($email, $cardId);
// Fund card (minimum $10.00)
$client->mastercardFundCard($email, $cardId, '50.00');
// Create a new Visa card
$client->visaCreateCard(
$email,
$name,
$nationalIdNumber,
$nationalIdImageUrl,
$userPhotoUrl,
'1990-01-15' // DOB
);
// Get all Visa cards
$client->visaGetAllCards($email);
// Get pending Visa cards
$client->visaGetPendingCards($email);
// Get specific card
$client->visaGetCard($email, $cardId);
// Get transactions
$client->visaGetTransactions($email, $cardId);
// Freeze/Unfreeze
$client->visaFreezeCard($email, $cardId);
$client->visaUnfreezeCard($email, $cardId);
// Fund card
$client->visaFundCard($email, $cardId, '50.00');
// Create a virtual Visa wallet card (minimum $5 funding deducted on creation)
$client->visaWalletCreateVirtualCard($email, $firstName, $lastName);
// Get all Visa wallet cards
$client->visaWalletGetAllCards($email);
// Get specific card details (ient->visaWalletBlockCard($email, $cardId);
$client->visaWalletUnblockCard($email, $cardId);
// Get wallet balance
$balance = $client->getWalletBalance();
// Get all deposits
$deposits = $client->getDeposits();
// Get all transactions
$transactions = $client->getTransactions();
// Get all Visa cards
$visaCards = $client->getAllVisaCards();
// Get all MasterCards
$mastercards = $client->getAllMastercards();
// Get all Digital cards
$digitalCards = $client->getAllDigitalCards();