PHP code example of bui-corporation / bui-payment
1. Go to this page and download the library: Download bui-corporation/bui-payment 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/ */
bui-corporation / bui-payment example snippets
use Bui\Payment\Facades\BuiPayment;
$services = BuiPayment::getServices();
use Bui\Payment\Facades\BuiPayment;
## Effectuer un paiement
$paymentData = [
'paymentMethod' => 'mobile_money',
'mobileMoney' => [
'service' => 'PAYIN_ORANGE_CI',
'amount' => 200,
'recipient' => '+225XXXXXXXXXX',
'reference' => 'unique_reference',
'note' => 'Transaction note',
'otpCode' => '123456',
],
'customer' => [
'firstname' => 'John',
'lastname' => 'Doe',
'email' => '[email protected] ',
'externalId' => '123456',
'phoneNumber' => '+225XXXXXXXXXX'
]
];
use Bui\Payment\Facades\BuiPayment;
$status = BuiPayment::getPaymentStatus('payment_id_here');
### Effectuer un transfert
use Bui\Payment\Facades\BuiPayment;
$transferData = [
'transferMethod' => 'mobile_money',
'mobileMoney' => [
'service' => 'PAYOUT_ORANGE_CI',
'amount' => 200,
'recipient' => '+225XXXXXXXXXX',
'reference' => 'unique_reference',
'note' => 'Transaction note'
],
'customer' => [
'firstname' => 'John',
'lastname' => 'Doe',
'email' => '[email protected] ',
'externalId' => '123456',
'phoneNumber' => '+225XXXXXXXXXX'
]
];
$transfer = BuiPayment::makeTransfer($transferData);
use Bui\Payment\Facades\BuiPayment;
$status = BuiPayment::getTransferStatus('transfer_id_here');
use Bui\Payment\Facades\BuiPayment;
$wallets = BuiPayment::getWallets();
use Bui\Payment\Facades\BuiPayment;
$balance = BuiPayment::getWalletBalance('wallet_id_here');
use Bui\Payment\Facades\BuiPayment;
$payinData = [
'amount' => 1000,
'walletId' => 'wallet_id_here'
];
$payin = BuiPayment::payin($payinData);
use Bui\Payment\Facades\BuiPayment;
$payoutData = [
'amount' => 500,
'walletId' => 'wallet_id_here'
];
$payout = BuiPayment::payout($payoutData);
bash
php artisan vendor:publish --provider="Bui\\Payment\\BuiPaymentServiceProvider"