Skip to content

Unofficial SDK for the Orange Money Burkina base API, designed to simplify its usage and integration by developers into PHP projects. This SDK does not handle the contractual aspect with Orange, and developers must contact Orange directly to obtain access and credentials.

License

Notifications You must be signed in to change notification settings

faso-dev/orange-money-burkina-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdk orange-money-burkina

SDK non officiel de l'API de base de Orange Money Burkina afin de faciliter son usage et son intégration par les développeurs dans des projets PHP.

Installation via composer

composer require faso-dev/orange-money-burkina-sdk

Cas d'utilisation

use Fasodev\Sdk\Config\TransactionData;
use Fasodev\Sdk\Exception\TransactionException;
use Fasodev\Sdk\OrangeMoneyAPI;
use Fasodev\Sdk\PaymentSDK;

require_once __DIR__ . '/vendor/autoload.php';

try {
    $orangeApi = (new OrangeMoneyAPI("username", "password", "merchant_number"))
                ->withTransactionData(TransactionData::from('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()}";
}

Testing

Exécutez les tests avec:

vendor/bin/phpunit

ou

composer tests

Authors

Merci de contribuer !

About

Unofficial SDK for the Orange Money Burkina base API, designed to simplify its usage and integration by developers into PHP projects. This SDK does not handle the contractual aspect with Orange, and developers must contact Orange directly to obtain access and credentials.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages