<?php
 
 
/**
 
This is an example file on how to use the Visa payment gateway integration package
 
*/
 
//NOTE: 1) You must have set up your stunnel server. 2) You must have configured the appropraite URLS in Visa.php
 
require_once ('Visa.php');
 
 
$reference_code = "1002323554";//transaction reference code
 
$amount = 2000;//amount you are charging to visa card
 
$description = "Payment for Gift Voucher";//description of transaction
 
 
$customer_email = "[email protected]";
 
$customer_phone = "8034423288";
 
 
//initialise the VISA payment gateway connection
 
 
$visa = Visa::ini('MERCHANT ID',$reference_code);
 
 
//create order 
 
 
$order = $visa->createOrder($amount,$description,$customer_email,$customer_phone);
 
 
/************End of Step 1, the next step is the check the status of your order******************/
 
 
//check status of order (this is after VISA has redirected to your APPROVAL_URL or DECLINE_URL)
 
$visa = Visa::ini('MERCHANT ID',$reference_code);
 
$orderStatus = $visa->getOrderStatus();
 
 
if($orderStatus->isApproved())echo "Transaction was successful";
 
if($orderStatus->isDeclined())echo "Transaction was not successful";
 
?>
 
 |