2017 © Pedro PelĂĄez
 

library orange-money-sdk

This is a php sdk for orange operator mobile money api.

image

foris-master/orange-money-sdk

This is a php sdk for orange operator mobile money api.

  • Sunday, May 6, 2018
  • by foris
  • Repository
  • 1 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 38 % Grown

The README.md

Orange Money Sdk

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads, (*1)

Note: orange-money-sdk., (*2)

This is a php sdk for orange operator mobile money api., (*3)

Install

Via Composer, (*4)

``` bash $ composer require foris-master/orange-money-sdk, (*5)


## Confing

Set AUTH_HEADER, MERCHANT_KEY,RETURN_URL,CANCEL_URL,NOTIF_URL enviroment variable ( .env file if using dotenv), you get all related to you console at https://developer.orange.com/ ```, (*6)

Usage

``` php use Foris\OmSdk\OmSdk;, (*7)

$om = new OmSdk(); // QuickStart /** * You need to set AUTH_HEADER, MERCHANT_KEY,RETURN_URL,CANCEL_URL,NOTIF_URL * enviroment variable ( .env file if using dotenv) */ $om->webPayment(['amount'=>100]); // Full Options $opt=[ "merchant_key"=> '********', "currency"=> "OUV", "order_id"=> $id, "amount"=> 0, "return_url"=> 'http://www.you-site.com/callback/return', "cancel_url"=> 'http://www.you-site.com/callback/cancel', "notif_url"=>'http://www.you-site.com/callback/notif', "lang"=> "fr" ]; $om->webPayment($opt);, (*8)


## API ### Get token ``` php use Foris\OmSdk\OmSdk; $om = new OmSdk(); $rep= $om->getToken(); var_dump($rep); // var_dump result [ "token_type"=> 'Bearer', "access_token"=> "0213GH123l12kj312k", "expires_in"=> "7776000", ];

Web Payment

``` php use Foris\OmSdk\OmSdk;, (*9)

$om = new OmSdk(); $opt = [ "merchant_key"=> '********', "currency"=> "OUV", "order_id"=> $id, "amount"=> 0, "return_url"=> 'http://www.you-site.com/callback/return', "cancel_url"=> 'http://www.you-site.com/callback/cancel', "notif_url"=>'http://www.you-site.com/callback/notif', "lang"=> "fr" ]; $rep= $om->webPayment($opt); var_dump($rep); // var_dump result [ "status"=> 201, "message"=> "OK", "pay_token"=> "87a9f2f8ebca97sdfdsbb49795f77981f5be1face7b6a543c8a1304d81e4299fd", "payment_url"=>"https://webpayment-sb.orange-money.com/payment/pay_token/87a9f2f8ebca97sdfdsbb49795f77981f5be1face7b6a543c8a1304d81e4299fd" "notif_token"=> "793d6157d9c7d52ae3920dc596956206" ];, (*10)


#### Note webPayment method automatically call getToken and set it in request header. ### Transaction Status ``` php use Foris\OmSdk\OmSdk; $om = new OmSdk(); $rep= $om->checkTransactionStatus($orderId,$amount,$pay_token); var_dump($rep); // var_dump result [ "status" => "SUCCESS", "order_id" => "MY_ORDER_ID_08082105_0023457", "txnid" => "MP150709.1341.A00073" ];

Note

The status could take one of the following values: INITIATED; PENDING; EXPIRED; SUCCESS; FAILED - INITIATED waiting for user entry - PENDING user has clicked on “Confirmer”, transaction is in progress on Orange side - EXPIRED user has clicked on “Confirmer” too late (after token’s validity) - SUCCESS payment is done - FAILED payment has failed, (*11)

Production

  For production your need to set your target country code in COUNTRY enviroment variable ( .env file if using dotenv)
  example : COUNTRY=cm

Testing

bash $ phpunit, (*12)

Contributing

Please see CONTRIBUTING for details., (*13)

Credits

License

The MIT License (MIT). Please see License File for more information., (*14)

The Versions

06/05 2018

dev-master

9999999-dev https://github.com/php-loep/:package_name

This is a php sdk for orange operator mobile money api.

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk money orange

06/05 2018

0.6.0

0.6.0.0 https://github.com/php-loep/:package_name

This is a php sdk for orange operator mobile money api.

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk money orange

25/04 2018

0.5.0

0.5.0.0 https://github.com/php-loep/:package_name

This is a php sdk for orange operator mobile money api.

  Sources   Download

MIT

The Requires

 

The Development Requires

php sdk money orange