PHP code example of elite / strowallet-sdk

1. Go to this page and download the library: Download elite/strowallet-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/ */

    

elite / strowallet-sdk example snippets


use Elite\StrowalletLaravel\Facades\Strowallet as StrowalletFacade;

// Get list of banks
$banks = StrowalletFacade::bank()->getBankList();

// Perform bank transfer
$response = StrowalletFacade::bank()->bankTransfer(
    amount: '50000',
    bankCode: '058',
    accountNumber: '0123456789',
    narration: 'Transfer for invoice',
    nameEnquiryRef: 'ref123456',
    senderName: 'Elite Corp'
);


use Elite\StrowalletLaravel\Strowallet;

class WalletController extends Controller
{
    public function showBalance(Strowallet $strowallet)
    {
        $balance = $strowallet->wallet()->getWalletBalance();
        return response()->json($balance);
    }
}


$strowallet->card()->createCardUser([
    'firstName' => 'John',
    'lastName' => 'Doe',
    // ... additional fields
]);

$strowallet->card()->createCard([
    'name_on_card' => 'John Doe',
    'card_type' => 'visa',
    'amount' => '100.00',
    'customerEmail' => '[email protected]'
]);

$strowallet->wallet()->transfer(
    amount: '100.00',
    currency: 'USD',
    receiver: '[email protected]',
    note: 'Payment for services'
);

// Fetch list of supported banks
$banks = $strowallet->bank()->getBankList();

// Verify bank account
$account = $strowallet->bank()->getBankName(
    bankCode: '000013',
    accountNumber: '0123456789'
);

// Initiate transfer
$transfer = $strowallet->bank()->bankTransfer(
    amount: '5000.00',
    bankCode: '058',
    accountNumber: '0123456789',
    narration: 'Salary payment',
    nameEnquiryRef: 'REF123456'
);

// Step 1: Create user
$user = $strowallet->card()->createCardUser([
    'firstName' => 'John',
    'lastName' => 'Doe',
    //  => 'visa',
    'amount' => '100.00',
    'customerEmail' => '[email protected]'
]);

// Step 3: Fund card
$fund = $strowallet->card()->fundCard([
    'card_id' => $card['id'],
    'amount' => '50.00'
]);

public function newMethod(array $data): Collection
{
    return $this->client->post('/new-endpoint', $data);
}
dotenv
STROWALLET_BASE_URL=https://strowallet.com/api
STROWALLET_API_KEY=your_pub_key_here