PHP API for Mobile phone TOPUP
PHP TOPUP API via the CAMOO AIRTIME gateway
This library needs minimum requirement for doing well on run.
- Sign up for a free CAMOO account
- Ask CAMOO Team for new access_key for developers
- CAMOO TOPUP API client for PHP requires version 5.5.x and above
Package is available on Packagist, you can install it using Composer.
composer require camoo/airtimeQuick Examples
- Get available general info about destination msisdn
require_once dirname(dirname(dirname(__DIR__))) . '/autoload.php';
// set api_key and secret_key
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// receiver recipient
$oAirtime->destination_msisdn='237671234567';
#Retrieve MsisdnInfo
$ohMsisdnInfo = $oAirtime->getMsisdnInfo();- Check available topup list and wholsale price list
$sTopupList = $ohMsisdnInfo->msisdn_info->topup_list;
// your prices for each topup product
$sWholeSalePriceList = $ohMsisdnInfo->msisdn_info->wholesale_price_list;- Choose a topup amount from the key topup_list and send airtime
// airtime from
$oAirtime->msisdn= '237661562859';
// airtime product
$oAirtime->topup=100;
var_dump($oAirtime->send());Assuming you have PHPUnit installed system wide using one of the methods stated here, you can run the tests for CAMOO/Aitime by doing the following:
- Go to library root
cd vendor/camoo/airtime - Copy
phpunit.xml.disttophpunit.xml. - Run
phpunit tests.