Highway to PSR2
[openemr.git] / portal / patient / fwk / libs / verysimple / Payment / PaymentRequest.php
blob530594707f6b736be37c8c3dc51519714e32f054
1 <?php
2 /** @package verysimple::Payment */
4 /**
5 * PaymentRequest is a generic object containing information necessary
6 * to process a payment through a payment gateway.
7 * To ensure that
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
16 * @version 2.0
18 class PaymentRequest
20 static $TRANSACTION_TYPE_AUTH_ONLY = "AUTH";
21 static $TRANSACTION_TYPE_AUTH_CAPTURE = "AUTH_CAPTURE";
22 public $SoftDescriptor = "";
23 public $OrderNumber = "";
24 public $InvoiceNumber = "";
25 public $CustomerFirstName = "";
26 public $CustomerLastName = "";
27 public $CustomerStreetAddress = "";
28 public $CustomerStreetAddress2 = "";
29 public $CustomerCity = "";
30 public $CustomerState = "";
31 public $CustomerZipCode = "";
32 public $CustomerCountry = "USA";
33 public $CustomerPhone = "";
34 public $CustomerEmail = "";
35 public $CustomerIP = "";
36 public $Comment;
37 public $TransactionAmount = "";
38 public $CCType = "";
39 public $CCNumber = "";
40 public $CCExpMonth = "";
41 public $CCExpYear = "";
42 public $CCSecurityCode = "";
43 public $TransactionCurrency = "USD";
45 // authorize.net specific
46 public $TransactionType = "AUTH_CAPTURE";
48 // skipjack specific
49 public $OrderString = "1~None~0.00~0~N~||";
50 public $CustomerName = "";
51 public $OrderDescription; // 22 chars (xxx*xxxxxxxxxxxxxxxxxx || xxxxxxx*xxxxxxxxxxxxxx || xxxxxxxxxxxx*xxxxxxxxx)
53 /**
55 * @deprecated
57 public $SerialNumber = "";
59 /**
61 * @deprecated
63 public $DeveloperSerialNumber = "";
65 /**
66 * Constructor
68 final function __construct()
70 $this->Init();
73 /**
74 * Called by base object on construction.
75 * override this
76 * to handle any special initialization
78 function Init()
80 $this->CustomerIP = array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER ['REMOTE_ADDR'] : '0.0.0.0';
83 /**
84 * This will populate all properties from the provided array argument
85 * Example: $req->Read($_REQUEST)
87 * @param array $arr
89 function Read($arr)
91 foreach (get_object_vars($this) as $prop) {
92 if (array_key_exists($prop, $arr)) {
93 $this->$prop = $arr [$prop];