1. Go to this page and download the library: Download kepson/wave-client 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/ */
kepson / wave-client example snippets
use Alal\WaveClient\Exceptions\OtpRequiredException;
try {
Wave::auth()->login(
mobile: '+2250700000000',
pin: '0000',
);
} catch (OtpRequiredException $e) {
// An SMS code has been sent to $e->mobile
// Store $e->tokenId if you need it; the package caches it automatically
echo "Code sent to {$e->mobile}";
}
Wave::auth()->confirmSms('123456');
// Session is now cached — subsequent calls are authenticated automatically
use Alal\WaveClient\Exceptions\AuthenticationException;
use Alal\WaveClient\Exceptions\OtpRequiredException;
try {
$txns = Wave::transactions()->list();
} catch (AuthenticationException $e) {
// Session expired — re-trigger your login flow
}
Wave::auth()->logout(); // clears the cached session
// Current month (default)
$transactions = Wave::transactions()->list();
// Custom date range and filters
$transactions = Wave::transactions()->list([
'start' => '2026-06-01',
'end' => '2026-06-30',
'limit' => 50,
'transactionType' => 'ALL', // 'ALL' | 'RECEIVED' | 'SENT'
'searchTerm' => null,
'customerMobileStr'=> '+2250700000000',
'n->name; // counterparty name
echo $txn->isPending; // bool
echo $txn->isCancelled; // bool
echo $txn->grossAmount; // before fees (MerchantSaleEntry, PayoutTransferEntry)
echo $txn->feeAmount; // fee charged
echo $txn->clientReference; // your reference (MerchantSaleEntry)
// $txn->raw — full raw GraphQL response array for this entry
}
// Find a single transaction by ID
$txn = Wave::transactions()->find('TXN_ID');
$balance = Wave::balance()->get();
echo $balance->amount; // e.g. "125000"
echo $balance->currency; // e.g. "XOF"
// Assert an action was called (any args)
$fake->assertSent('balance.get');
$fake->assertSent('payout.send');
$fake->assertSent('transactions.list');
$fake->assertSent('paymentRequest.create');
// Assert with argument inspection
$fake->assertSent('payout.send', fn(array $args) =>
$args['mobile'] === '+2250700000000' &&
$args['amount'] === '5000'
);
$fake->assertSent('auth.login', fn(array $args) =>
$args['phone'] === '+2250700000000'
);
// Assert an action was NOT called
$fake->assertNotSent('payout.send');
// Assert nothing at all was sent
$fake->assertNothingSent();
it('sends a payout when a payment is approved', function () {
$fake = Wave::fake();
$fake->queuePayout([
'id' => 'p-1',
'status' => 'processing',
'amount' => '5000',
'currency' => 'XOF',
'mobile' => '+2250700000000',
]);
// Call the service that internally uses Wave::payout()->send(...)
app(PaymentService::class)->disburse($payment);
$fake->assertSent('payout.send', fn(array $args) =>
$args['mobile'] === '+2250700000000'
);
});