2 /** @package verysimple::Payment */
5 * PaymentRequest is a generic object containing information necessary
6 * to process a payment through a payment gateway.
8 * your PaymentRequest can be processed independantly of payment gateway,
9 * it is best not to extend this class, rather write a PaymentProcessor
10 * that will work correctly for the particular payment gateway.
12 * @package verysimple::Payment
13 * @author VerySimple Inc.
14 * @copyright 1997-2007 VerySimple, Inc.
15 * @license http://www.gnu.org/licenses/lgpl.html LGPL
18 class PaymentRequest
{
19 static $TRANSACTION_TYPE_AUTH_ONLY = "AUTH";
20 static $TRANSACTION_TYPE_AUTH_CAPTURE = "AUTH_CAPTURE";
21 public $SoftDescriptor = "";
22 public $OrderNumber = "";
23 public $InvoiceNumber = "";
24 public $CustomerFirstName = "";
25 public $CustomerLastName = "";
26 public $CustomerStreetAddress = "";
27 public $CustomerStreetAddress2 = "";
28 public $CustomerCity = "";
29 public $CustomerState = "";
30 public $CustomerZipCode = "";
31 public $CustomerCountry = "USA";
32 public $CustomerPhone = "";
33 public $CustomerEmail = "";
34 public $CustomerIP = "";
36 public $TransactionAmount = "";
38 public $CCNumber = "";
39 public $CCExpMonth = "";
40 public $CCExpYear = "";
41 public $CCSecurityCode = "";
42 public $TransactionCurrency = "USD";
44 // authorize.net specific
45 public $TransactionType = "AUTH_CAPTURE";
48 public $OrderString = "1~None~0.00~0~N~||";
49 public $CustomerName = "";
50 public $OrderDescription; // 22 chars (xxx*xxxxxxxxxxxxxxxxxx || xxxxxxx*xxxxxxxxxxxxxx || xxxxxxxxxxxx*xxxxxxxxx)
56 public $SerialNumber = "";
62 public $DeveloperSerialNumber = "";
67 final function __construct() {
72 * Called by base object on construction.
74 * to handle any special initialization
77 $this->CustomerIP
= array_key_exists ( 'REMOTE_ADDR', $_SERVER ) ?
$_SERVER ['REMOTE_ADDR'] : '0.0.0.0';
81 * This will populate all properties from the provided array argument
82 * Example: $req->Read($_REQUEST)
87 foreach ( get_object_vars ( $this ) as $prop ) {
88 if (array_key_exists ( $prop, $arr )) {
89 $this->$prop = $arr [$prop];