Login   Register  
PHP Classes
elePHPant
Icontem

File: example.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Leigh Edwards  >  PHP GlobalPay API  >  example.txt  >  Download  
File: example.txt
Role: Example script
Content type: text/plain
Description: this is a simple example
Class: PHP GlobalPay API
Process credit card payments using GlobalPay
Author: By
Last change: better example
Date: 1 year ago
Size: 711 bytes
 

Contents

Class file image Download
$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
}