Login   Register  
PHP Classes

File: AIM-sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Blaine Simpson  >  AIM  >  AIM-sample.php  >  Download  
File: AIM-sample.php
Role: Example script
Content type: text/plain
Description: sample end-user script
Class: AIM
Submit Authorize.net credit card charges
Author: By
Last change:
Date: 8 years ago
Size: 2,022 bytes


Class file image Download
#!/usr/bin/php5 -q

// The AIM class may be used according to the BSD license, as documented
// in AIM.php.

 * Example that uses my AIM class.
 * You need to pur AIM.php and CSVTokenizer.php into your PHP search path.

require_once "AIM.php";
$ai = new AIM();
$ai->setBillOrg("Your Corp.");
$ai->setBillAddress("271 Leafy Rd.,   Steptoe Turnoff");
$ai->setBillCity("Blueberry Point");
$ai->setDescription("Widget(s) purchase");
$ai->setShipOrg("GCPF Inc.");
$ai->setShipAddress("PO Box 54");
$ai->setCardNum("4007000000027");  // Test VISA credit card number
                                       // See the AIM docs for test numbers
                                       // for other cards, and for how to
                                       // emulate refusals.
$ai->toString() . "\n";
"RCODE: " $ai->getRcode() . "\n";
"RRCODE: " $ai->getRRcode() . "\n";
"RRTEXT: " $ai->getRRtext() . "\n";
"APPROVAL CODE: " $ai->getApproval() . "\n";
"AVS RESULT CODE: " $ai->getAVS() . "\n";
"TRANS ID: " $ai->getTransId() . "\n";
"AMOUNT: " $ai->getAmount() . "\n";
"TRANS TYPE: " $ai->getTransType() . "\n";
"\nValidated ok\n";