47 var $eps_v3plus_responses = Array(
57 var $card_types = Array(
59 "mastercard"=>
"mastercard",
61 "dinersclub"=>
"dinersclub",
65 var $test_card_numbers = Array (
66 "testsuccess" =>
"Test Success",
67 "testfailure" =>
"Test Failure",
68 "testtimeout" =>
"Test Timeout"
71 var $_status_codes = Array (
73 '01' =>
'refer to issuer',
74 '02' =>
'refer to issuer\'s special conditions',
75 '03' =>
'invalid merchant',
76 '04' =>
'pickup card',
77 '05' =>
'do not honour',
79 '07' =>
'pickup card, special conditions',
81 '09' =>
'request in progress',
82 '10' =>
'approved for partial amount',
83 '11' =>
'approved VIP',
84 '12' =>
'invalid transaction',
85 '13' =>
'invalid amount',
86 '14' =>
'invalid card number',
87 '15' =>
'no such issuer',
88 '16' =>
'approved, update track 3',
89 '17' =>
'customer cancellation',
90 '18' =>
'customer dispute',
91 '19' =>
're-enter transaction',
92 '20' =>
'invalid response',
93 '21' =>
'no action taken',
94 '22' =>
'suspected malfunction',
95 '23' =>
'unacceptable transaction fee',
96 '24' =>
'file date not supported',
97 '25' =>
'unable to locate record on file',
98 '26' =>
'duplicate file update record, old record replaced',
99 '27' =>
'file update field error',
100 '28' =>
'file update file locked out',
101 '29' =>
'file update not successful, contact acquirer',
102 '30' =>
'format error',
103 '31' =>
'bank not supported by switch',
104 '32' =>
'completed partially',
105 '33' =>
'expired card',
106 '34' =>
'suspected fraud',
107 '35' =>
'contact acquirer',
108 '36' =>
'restricted card',
109 '37' =>
'contact acquirer security',
110 '38' =>
'allowable PIN retries exceeded',
111 '39' =>
'no credit account',
112 '40' =>
'request function not supported',
114 '42' =>
'no universal account',
115 '43' =>
'stolen card',
116 '44' =>
'no investment account',
117 '51' =>
'insufficient funds',
118 '52' =>
'no cheque account',
119 '53' =>
'no savings account',
120 '54' =>
'expired card',
121 '55' =>
'incorrect PIN',
122 '56' =>
'no card record',
123 '57' =>
'transaction not permitted to cardholder',
124 '58' =>
'transaction not permitted to terminal',
125 '59' =>
'suspected fraud',
126 '60' =>
'contact acquirer',
127 '61' =>
'exceeds withdrawal amount limit',
128 '62' =>
'restricted card',
129 '63' =>
'security violation',
130 '64' =>
'original amount incorrect',
131 '65' =>
'exceeds withdrawal frequency limit',
132 '66' =>
'contact acquirer security',
133 '67' =>
'hard capture',
134 '68' =>
'response received too late',
135 '75' =>
'allowable number of PIN retries exceeded',
136 '90' =>
'cutoff in progress',
137 '91' =>
'issuer inoperative',
138 '92' =>
'financial institution cannot be found',
139 '93' =>
'transaction cannot be completed, violation of law',
140 '94' =>
'duplicate transmission',
141 '95' =>
'reconcile error',
142 '96' =>
'system malfunction',
143 '97' =>
'reconciliation totals have been reset',
145 '99' =>
'reserved, will not be returned'
154 $this->parameters = Array();
155 $this->response = Array();
157 $this->
set(
'EPS_CCV',
'');
158 $this->
set(
'EPS_VERSION', 3);
159 $this->
set(
'EPS_TEST',
'false');
160 $this->
set(
'EPS_3DSECURE',
'false');
174 function set($name, $value)
176 $this->parameters[$name] = $value;
191 if (!is_array($this->parameters[$name])) {
192 $this->parameters[$name] = Array();
194 $this->parameters[$name][] = $value;
208 return $this->parameters[$name];
225 $amount = floor($amount);
227 $amount = sprintf(
'%01.2f',$amount);
229 $this->
set(
'EPS_AMOUNT', $amount);
242 return $this->
get(
'EPS_AMOUNT');
255 return $this->card_types;
268 return $this->test_card_numbers;
283 $this->
set(
'EPS_CARDTYPE', $type);
297 $this->_url = $new_url;
324 $response[
'REFERENCE'] = isset($this->response[
'ref-id']) ? $this->response[
'ref-id'] :
'';
325 $response[
'AUTHORISATION'] = isset($this->response[
'auth-id']) ? $this->response[
'auth-id'] :
'';
326 $response[
'MESSAGE_CODE'] = isset($this->response[
'message']) ? substr($this->response[
'message'], 0, 3) :
'';
327 $response[
'MESSAGE'] = isset($this->response[
'message']) ? substr($this->response[
'message'], 4) :
'';
328 $response[
'STATUS'] = isset($this->response[
'eft-response']) ? $this->response[
'eft-response'] :
'';
329 $response[
'TRANSACTION'] = isset($this->response[
'txn-id']) ? $this->response[
'txn-id'] :
'';
330 $response[
'DATE'] = isset($this->response[
'settlement-date']) ? $this->response[
'settlement-date'] :
'';
346 $code = $this->response[
'eft-response'];
347 if (isset($this->_status_codes[$code])) {
348 $result = $this->_status_codes[$code];
368 $this->
set(
'EPS_MERCHANT', $merchant_no);
383 $this->
set(
'EPS_REFERENCEID', $ref_no);
398 $this->
set(
'EPS_CCV', $ccv_no);
413 $this->
set(
'EPS_CARDNUMBER', $card_no);
428 $this->
set(
'EPS_EXPIRYMONTH', $month);
443 $this->
set(
'EPS_EXPIRYYEAR', $year);
457 $this->
set(
'EPS_NAMEONCARD', $name);
471 $this->
set(
'EPS_INFOEMAIL',
'mailto: '.$email);
486 if ($email && is_array($this->
get(
'EPS_RESULTURL'))) {
488 $value =
'mailto:'.$value;
490 $this->
setArray(
'EPS_RESULTURL', $value);
507 $this->
set(
'EPS_TEST',
'true');
508 $this->
set(
'EPS_CARDTYPE',
'testcard');