elite / strowallet-sdk
A simple SDK for making payments and creating USD virtual cards via the Strowallet API.
Requires
- guzzlehttp/guzzle: ^7.9
- illuminate/support: ^12.10
Requires (Dev)
- phpunit/phpunit: ^11.5
README
A clean and developer-friendly Laravel SDK for interacting with Strowallet, supporting virtual cards, wallet transfers, and bank transactions with ease.
๐ Table of Contents
- โจ Features
- ๐ฆ Installation
- โ๏ธ Configuration
- ๐ Usage
- ๐ก Examples
- ๐งน Extending
- ๐งช Testing
- ๐ License
- ๐ค Contributing
- ๐ Credits
โจ Features
- ๐ Virtual card issuance and management
- ๐ธ Wallet-to-wallet transfers
- ๐ฆ Bank verification and transfers
- โ๏ธ Simple Laravel service-based architecture
- โ Built-in request validation and error handling
- ๐ Clean, readable, and extendable codebase
๐ฆ Installation
Install via Composer:
composer require elite/strowallet-sdk
โ๏ธ Configuration
Add the following to your .env
file:
STROWALLET_BASE_URL=https://strowallet.com/api STROWALLET_API_KEY=your_pub_key_here
๐ Usage
You can access services in two ways:
โ Via Facade (Recommended)
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' );
โ Via Dependency Injection
use Elite\StrowalletLaravel\Strowallet; class WalletController extends Controller { public function showBalance(Strowallet $strowallet) { $balance = $strowallet->wallet()->getWalletBalance(); return response()->json($balance); } }
Card Service
$strowallet->card()->createCardUser([ 'firstName' => 'John', 'lastName' => 'Doe', // ... additional fields ]); $strowallet->card()->createCard([ 'name_on_card' => 'John Doe', 'card_type' => 'visa', 'amount' => '100.00', 'customerEmail' => 'john@example.com' ]);
Available Card Methods
createCardUser(array $data)
updateCardHolder(array $data)
getCardHolder(string $customerEmail)
createCard(array $data)
fundCard(array $data)
getCardDetails(string $cardId)
cardAction(string $cardId, string $action)
โ freeze/unfreezewithdrawCard(array $data)
getCardTransactions(string $cardId)
createGiftCard(array $data)
Wallet Service
$strowallet->wallet()->transfer( amount: '100.00', currency: 'USD', receiver: 'recipient@example.com', note: 'Payment for services' );
Bank Service
// 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' );
๐ก Examples
Full Virtual Card Flow
// Step 1: Create user $user = $strowallet->card()->createCardUser([ 'firstName' => 'John', 'lastName' => 'Doe', // required fields... ]); // Step 2: Create virtual card $card = $strowallet->card()->createCard([ 'name_on_card' => 'John Doe', 'card_type' => 'visa', 'amount' => '100.00', 'customerEmail' => 'john@example.com' ]); // Step 3: Fund card $fund = $strowallet->card()->fundCard([ 'card_id' => $card['id'], 'amount' => '50.00' ]);
๐งน Extending
You can easily add custom methods to the SDK:
public function newMethod(array $data): Collection { return $this->client->post('/new-endpoint', $data); }
Just define your method in the appropriate service class (CardService
, WalletService
, etc.).
๐งช Testing
Coming soon. The test suite will be available to ensure SDK stability and easy contribution.
In the meantime, you can run:
composer test
๐ License
This package is open-source software licensed under the MIT license.
๐ค Contributing
We welcome all contributions!
Please read our CONTRIBUTING.md for guidelines on submitting issues, feature requests, and pull requests.
๐ Credits
- Developed by Elite
- Powered by Strowallet