$globalPayObj = new globalPay ();
 
// set the merchant
 
$globalPayObj->setMerchantID ( 3 );
 
// process payment
 
if ($globalPayObj->charge ( $creditCardNumber, $expiryDate, $amount, $invoiceNumber)) {
 
    // if we get here it means that global accepted and processed the request
 
    
 
    // get the responce code from global
 
// the responce code tells us if the payment was approved or not
 
    $result = $globalPayObj->getResult ();
 
 
    if ($result == 0) { // 0 is the ONLY approval responce
 
        // Process approved needed
 
    } else { // all other responces are declines user the responce code array to work out what each one means
 
        // process decline as needed
 
        }
 
} else {
 
// hande failed process requests here
 
}
 
 |