New onsite patient portal, take 4.
[openemr.git] / portal / patient / fwk / libs / verysimple / Payment / PaymentRequest.php
blob0cf844ee5bf0ae5445c647f1d74cbf9104a2a221
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 {
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 = "";
35 public $Comment;
36 public $TransactionAmount = "";
37 public $CCType = "";
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";
47 // skipjack specific
48 public $OrderString = "1~None~0.00~0~N~||";
49 public $CustomerName = "";
50 public $OrderDescription; // 22 chars (xxx*xxxxxxxxxxxxxxxxxx || xxxxxxx*xxxxxxxxxxxxxx || xxxxxxxxxxxx*xxxxxxxxx)
52 /**
54 * @deprecated
56 public $SerialNumber = "";
58 /**
60 * @deprecated
62 public $DeveloperSerialNumber = "";
64 /**
65 * Constructor
67 final function __construct() {
68 $this->Init ();
71 /**
72 * Called by base object on construction.
73 * override this
74 * to handle any special initialization
76 function Init() {
77 $this->CustomerIP = array_key_exists ( 'REMOTE_ADDR', $_SERVER ) ? $_SERVER ['REMOTE_ADDR'] : '0.0.0.0';
80 /**
81 * This will populate all properties from the provided array argument
82 * Example: $req->Read($_REQUEST)
84 * @param array $arr
86 function Read($arr) {
87 foreach ( get_object_vars ( $this ) as $prop ) {
88 if (array_key_exists ( $prop, $arr )) {
89 $this->$prop = $arr [$prop];