Commit 5b82cec2 by Camoo Sarl

View sent airtime added

parent 6a7423da
<?php
require_once('src/autoload.php');
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// set transaction Id
$oAirtime->id = '50';
var_dump($oAirtime->view());
<?php
require_once('src/autoload.php');
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// receiver recipient
$oAirtime->destination_msisdn='237671234567';
// airtime from
$oAirtime->msisdn='237340404';
// airtime amount
$oAirtime->topup=100;
// just to test
$oAirtime->test_mode=true;
/*
$oAirtime->send_sms=true;
$oAirtime->sms='Developer own custom message';
$oAirtime->sender_sms=true;
$oAirtime->sender_text='Customer own custom message';
*/
#Retrieve TopUp option for a phone number
//var_dump($oAirtime->getTopupList());
#Retrieve MsisdnInfo
//var_dump($oAirtime->getMsisdnInfo());
#retrieve WholeSalePriceList
//var_dump($oAirtime->getWholeSalePriceList());
#Retrieve retail price list
//var_dump($oAirtime->getRetailPriceList());
var_dump($oAirtime->send());
<?php
require_once('src/autoload.php');
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// receiver recipient
$oAirtime->destination_msisdn='237671234567';
#Retrieve MsisdnInfo
var_dump($oAirtime->getMsisdnInfo());
<?php
require_once('src/autoload.php');
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// receiver recipient
$oAirtime->destination_msisdn='237671234567';
#Retrieve retail price list
var_dump($oAirtime->getRetailPriceList());
<?php
require_once('src/autoload.php');
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// receiver recipient
$oAirtime->destination_msisdn='237671234567';
#Retrieve TopUp option for a phone number
var_dump($oAirtime->getTopupList());
<?php
require_once('src/autoload.php');
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// receiver recipient
$oAirtime->destination_msisdn='237671234567';
#retrieve WholeSalePriceList
var_dump($oAirtime->getWholeSalePriceList());
<?php
require_once('src/autoload.php');
$oAirtime = new \CAMOO\Airtime\Airtime('592595095gh57', '4e32da5979879b89479847b9798479494984');
// receiver recipient
$oAirtime->destination_msisdn='237674911204';
// airtime from
$oAirtime->msisdn= '237661562859';
// airtime product
$oAirtime->topup=100;
// just to test
//$oAirtime->test_mode=true;
$oAirtime->send_sms=true;
// set developer custom message
$oAirtime->sms='YourCompany Best Topup Service'; // max length 30 chars
var_dump($oAirtime->send());
...@@ -78,4 +78,20 @@ class Airtime extends Client{ ...@@ -78,4 +78,20 @@ class Airtime extends Client{
die; die;
} }
} }
/**
* Read sent Topup by Id
*
* @param integer $iTransactionId
* @return mixed Message
*/
public function view() {
$this->oHttpClient->setResourceName('view');
try {
return $this->get(Payload::create()->get(true, 'view'));
} catch ( CamooException $err ) {
echo $err->getMessage();
exit();
}
}
} }
...@@ -25,9 +25,8 @@ final class Payload{ ...@@ -25,9 +25,8 @@ final class Payload{
private $topup = null; private $topup = null;
private $send_sms = false; private $send_sms = false;
private $sms = null; private $sms = null;
private $sender_sms = false;
private $sender_text = null;
private $test_mode = false; private $test_mode = false;
private $id = 0;
protected static $_create = null; protected static $_create = null;
public static function create() public static function create()
...@@ -45,6 +44,18 @@ final class Payload{ ...@@ -45,6 +44,18 @@ final class Payload{
return $oValidator; return $oValidator;
} }
private function ValidatorView(Validator $oValidator) {
$oValidator
->rule('required', ['id']);
$oValidator
->rule('integer', 'id');
$this->notBlankRule($oValidator, 'id');
return $oValidator;
}
private function ValidatorSend(Validator $oValidator) { private function ValidatorSend(Validator $oValidator) {
$oValidator $oValidator
->rule('required', ['destination_msisdn', 'topup', 'msisdn']); ->rule('required', ['destination_msisdn', 'topup', 'msisdn']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment