PHP code example of faso-dev / orange-money-burkina-sdk
1. Go to this page and download the library: Download faso-dev/orange-money-burkina-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/ */
faso-dev / orange-money-burkina-sdk example snippets
use Fasodev\Sdk\Config\TransactionData;
use Fasodev\Sdk\Exception\TransactionException;
use Fasodev\Sdk\OrangeMoneyAPI;
use Fasodev\Sdk\PaymentSDK;
client_number', 'payment_amount', 'otp_code'))
->withCustomReference("123456778") //optionnal
->useProdApi() // for production
->withoutSSLVerification() //if you have any troubleshoot with ssl verifcation(not recommended)
;
$response = (new PaymentSDK($orangeApi))->handlePayment();
echo 'Thank you for your purchasse !';
echo $response->getTransactionId();
} catch (TransactionException $exception) {
echo "Whoops! Unable to process payment. <br/>
Error message returned by request: {$exception->getMessage()}. <br/>
Error code returned by request: {$exception->getCode()}";
}