dev-master
9999999-devOnerecharge agents integration php library
ISC
The Requires
- php ^5.3.3 || ^7.0
- guzzlehttp/guzzle 6.2.*
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Onerecharge agents integration php library
API ACCESS KEY from your agent dashboard) use Onerecharge\Agent;
use Onerecharge\Util;
use Onerecharge\BillPayment;
//use the Util function like this to get array of supported telco names:
echo Util::getSupportedBillType();
//then get an Authorization token. you should store the retrieved token somewhere in your code.
//tokens can be destroyed from your admin portal anytime (do not store your agent_id and password in your code.)
$token = Agent::getToken($agent_id, $password);
$agent = new Agent(API_ACCESS_KEY, $token);
$billpayment = new BillPayment($agent);
echo $billpayment->airtimeTopup("08025***373", "Etisalat", 100);
The recommended way to install onerecharge-php is through Composer., (*1)
# Install Composer curl -sS https://getcomposer.org/installer | php
Next, run the Composer command to install the latest stable version of Guzzle:, (*2)
php composer.phar require onerecharge/onerecharge-php
After installing, you need to require Composer's autoloader:, (*3)
require 'vendor/autoload.php';
You can then later update onerecharge-php using composer:, (*4)
bash
composer.phar update, (*5)
Onerecharge agents integration php library
ISC