1 | <?php |
||
6 | class DpsPxPayComs extends Object |
||
|
|||
7 | { |
||
8 | private static $pxpay_url = 'https://sec.paymentexpress.com/pxaccess/pxpay.aspx'; |
||
9 | |||
10 | private static $pxpay_userid = ""; |
||
11 | |||
12 | private static $pxpay_encryption_key = ""; |
||
13 | |||
14 | private static $alternative_thirdparty_folder = ""; |
||
15 | |||
16 | private static $overriding_txn_type = ""; //e.g. AUTH |
||
17 | |||
18 | public static function get_txn_type() |
||
23 | |||
24 | |||
25 | /** |
||
26 | * customer details |
||
27 | **/ |
||
28 | |||
29 | protected $TxnData1 = ""; |
||
30 | public function setTxnData1($v) |
||
34 | protected $TxnData2 = ""; |
||
35 | public function setTxnData2($v) |
||
39 | protected $TxnData3 = ""; |
||
40 | public function setTxnData3($v) |
||
44 | protected $EmailAddress = ""; |
||
45 | public function setEmailAddress($v) |
||
49 | |||
50 | /** |
||
51 | * order details |
||
52 | **/ |
||
53 | protected $AmountInput = 0; |
||
54 | public function setAmountInput($v) |
||
58 | |||
59 | protected $MerchantReference = ""; |
||
60 | public function setMerchantReference($v) |
||
64 | |||
65 | protected $CurrencyInput = "NZD"; |
||
66 | public function setCurrencyInput($v) |
||
70 | |||
71 | protected $TxnType = "Purchase"; |
||
72 | public function setTxnType($v) |
||
76 | |||
77 | protected $TxnId = ""; |
||
78 | public function setTxnId($v) |
||
82 | |||
83 | /** |
||
84 | * details of the redirection |
||
85 | **/ |
||
86 | protected $UrlFail = ""; |
||
87 | public function setUrlFail($v) |
||
91 | protected $UrlSuccess = ""; |
||
92 | public function setUrlSuccess($v) |
||
96 | |||
97 | /** |
||
98 | * Details to use stored cards |
||
99 | */ |
||
100 | protected $EnableAddBillCard = 0; |
||
101 | public function setEnableAddBillCard($v) |
||
105 | protected $BillingId = 0; |
||
106 | public function setBillingId($v) |
||
110 | |||
111 | /** |
||
112 | * external object |
||
113 | **/ |
||
114 | protected $PxPayObject = null; |
||
115 | protected $response = null; |
||
116 | |||
117 | public function __construct() |
||
139 | |||
140 | /* |
||
141 | * This function formats data into a request and returns redirection URL |
||
142 | * NOTE: you will need to set all the variables prior to running this. |
||
143 | * e.g. $myDPSPxPayComsObject->setMerchantReference("myreferenceHere"); |
||
144 | **/ |
||
145 | public function startPaymentProcess() |
||
223 | |||
224 | |||
225 | /* |
||
226 | * This function receives information back from the payments page as a response object |
||
227 | * --------------------- RESPONSE DATA --------------------- |
||
228 | * $Success = $responseObject->getSuccess(); # =1 when request succeeds |
||
229 | * $AmountSettlement = $responseObject->getAmountSettlement(); |
||
230 | * $AuthCode = $responseObject->getAuthCode(); # from bank |
||
231 | * $CardName = $responseObject->getCardName(); # e.g. "Visa" |
||
232 | * $CardNumber = $responseObject->getCardNumber(); # Truncated card number |
||
233 | * $DateExpiry = $responseObject->getDateExpiry(); # in mmyy format |
||
234 | * $DpsBillingId = $responseObject->getDpsBillingId(); |
||
235 | * $BillingId = $responseObject->getBillingId(); |
||
236 | * $CardHolderName = $responseObject->getCardHolderName(); |
||
237 | * $DpsTxnRef = $responseObject->getDpsTxnRef(); |
||
238 | * $TxnType = $responseObject->getTxnType(); |
||
239 | * $TxnData1 = $responseObject->getTxnData1(); |
||
240 | * $TxnData2 = $responseObject->getTxnData2(); |
||
241 | * $TxnData3 = $responseObject->getTxnData3(); |
||
242 | * $CurrencySettlement= $responseObject->getCurrencySettlement(); |
||
243 | * $ClientInfo = $responseObject->getClientInfo(); # The IP address of the user who submitted the transaction |
||
244 | * $TxnId = $responseObject->getTxnId(); |
||
245 | * $CurrencyInput = $responseObject->getCurrencyInput(); |
||
246 | * $EmailAddress = $responseObject->getEmailAddress(); |
||
247 | * $MerchantReference = $responseObject->getMerchantReference(); |
||
248 | * $ResponseText = $responseObject->getResponseText(); |
||
249 | * $TxnMac = $responseObject->getTxnMac(); # An indication as to the uniqueness of a card used in relation to others |
||
250 | * |
||
251 | * also see: https://www.paymentexpress.com/technical_resources/ecommerce_hosted/error_codes.html |
||
252 | **/ |
||
253 | |||
254 | public function processRequestAndReturnResultsAsObject() |
||
260 | |||
261 | public function getDebugMessage() |
||
269 | |||
270 | public function debug() |
||
275 | } |
||
276 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.