fbpx
  • Find us on TripAdvisor!
  • Excellent Reviews
  • Exclusive Safaris
  • Customised Excursions
ipay

ipay

[insert_php]
/*
This is a sample PHP script of how you would ideally integrate with iPay Payments Gateway and also handling the
callback from iPay and doing the IPN check

—————————————————————————————————-
************(A.) INTEGRATING WITH iPAY ***********************************************
—————————————————————————————————-
*/
//Data needed by iPay a fair share of it obtained from the user from a form e.g email, number etc…
$fields = array( “amount”=> $_POST[‘ttl’],
“cbk”=> $_SERVER[“HTTP_HOST”].$_SERVER[“REQUEST_URI”], //substitute with a thank you link
“curr”=> $_POST[‘curr’],
“email”=> $_POST[’eml’],
“oid”=> $_POST[‘oid’],
“p1″=> $_POST[‘p1’],
“phone”=> $_POST[‘tel’],
“vid”=> “stanbiclcc1”
);
/*
—————————————————————————————————-
************(b.) GENERATING THE HASH PARAMETER FROM THE DATASTRING *********************************
—————————————————————————————————-

The datastring IS concatenated from the data above
*/
$datastring = “amount=”.$fields[‘amount’].”&cbk=”.$fields[‘cbk’].”&curr=”.$fields[‘curr’].”&email=”.$fields[’email’].”&oid=”.$fields[‘oid’].”&p1=”.$fields[‘p1’].”&phone=”.$fields[‘phone’].”&vid=”.$fields[‘vid’];
$hashkey =”stanbiclcc1″;//use “demo” for testing where vid also is set to “demo”

/********************************************************************************************************
* Generating the HashString sample
*/
$generated_hash = hash_hmac(“sha256”,$datastring, $hashkey);

[/insert_php]

[insert_php]
foreach ($fields as $key => $value) {
//echo $key;
echo ‘ ‘;
}
[/insert_php]


Our Accreditations and Booking Security

Natural World Kenya safaris is Member No.FA/440 - Kenya Association of Tour Operators (KATO) bonding scheme. The scheme is insured to guarantee your holiday safari in the unlikely event that a bonded KATO member ceases operating.

Sign Up To Our
Newsletter

ipay
2018-03-27T04:38:27+03:00
Humphrey