@@ -16,88 +16,88 @@ public function __construct(RequestInterface $request, $data)
1616 $ this ->request = $ request ;
1717 $ temp = explode ('|,| ' , substr ($ data , 1 , -1 ));
1818
19- $ response_fields = array (
20- 'Response Code ' ,
21- 'Response Subcode ' ,
22- 'Response Reason Code ' ,
23- 'Response Reason Text ' ,
24- 'Authorization Code ' ,
25- 'AVS Response ' ,
26- 'Transaction ID ' ,
27- 'Invoice Number ' ,
28- 'Description ' ,
29- 'Amount ' ,
30- 'Method ' ,
31- 'Transaction Type ' ,
32- 'Customer ID ' ,
33- 'First Name ' ,
34- 'Last Name ' ,
35- 'Company ' ,
36- 'Address ' ,
37- 'City ' ,
38- 'State ' ,
39- 'ZIP Code ' ,
40- 'Country ' ,
41- 'Phone ' ,
42- 'Fax ' ,
43- 'Email Address ' ,
44- 'Ship To First Name ' ,
45- 'Ship To Last Name ' ,
46- 'Ship To Company ' ,
47- 'Ship To Address ' ,
48- 'Ship To City ' ,
49- 'Ship To State ' ,
50- 'Ship To ZIP Code ' ,
51- 'Ship To Country ' ,
52- 'Tax ' ,
53- 'Duty ' ,
54- 'Freight ' ,
55- 'Tax Exempt ' ,
56- 'Purchase Order Number ' ,
57- 'MD5 Hash ' ,
58- 'Card Code Response ' ,
59- 'Cardholder Authentication Verification Response ' ,
60- 'Account Number ' ,
61- 'Card Type ' ,
62- 'Split Tender ID ' ,
63- 'Requested Amount ' ,
64- 'Balance On Card '
65- );
66-
67- $ response = array ();
68-
69- foreach ($ response_fields as $ field )
70- {
71- $ response [$ field ] = array_shift ($ temp );
72- }
73-
74- $ response_codes = array (
75- 1 => 'Approved ' ,
76- 2 => 'Declined ' ,
77- 3 => 'Error ' ,
78- 4 => 'Held for Review '
79- );
80-
81- $ avs_response_codes = array (
82- 'A ' => 'Address (Street) matches, ZIP does not ' ,
83- 'B ' => 'Address information not provided for AVS check ' ,
84- 'E ' => 'AVS error ' ,
85- 'G ' => 'Non-U.S. Card Issuing Bank ' ,
86- 'N ' => 'No Match on Address (Street) or ZIP ' ,
87- 'P ' => 'AVS not applicable for this transaction ' ,
88- 'R ' => 'Retry?System unavailable or timed out ' ,
89- 'S ' => 'Service not supported by issuer ' ,
90- 'U ' => 'Address information is unavailable ' ,
91- 'W ' => 'Nine digit ZIP matches, Address (Street) does not ' ,
92- 'X ' => 'Address (Street) and nine digit ZIP match ' ,
93- 'Y ' => 'Address (Street) and five digit ZIP match ' ,
94- 'Z ' => 'Five digit ZIP matches, Address (Street) does not '
95- );
96-
97- $ response ['Response Code ' ] = $ response_codes [$ response ['Response Code ' ]];
98- $ response ['AVS Response ' ] = $ avs_response_codes [$ response ['AVS Response ' ]];
99-
100- $ this ->data = $ response ;
19+ $ response_fields = array (
20+ 'Response Code ' ,
21+ 'Response Subcode ' ,
22+ 'Response Reason Code ' ,
23+ 'Response Reason Text ' ,
24+ 'Authorization Code ' ,
25+ 'AVS Response ' ,
26+ 'Transaction ID ' ,
27+ 'Invoice Number ' ,
28+ 'Description ' ,
29+ 'Amount ' ,
30+ 'Method ' ,
31+ 'Transaction Type ' ,
32+ 'Customer ID ' ,
33+ 'First Name ' ,
34+ 'Last Name ' ,
35+ 'Company ' ,
36+ 'Address ' ,
37+ 'City ' ,
38+ 'State ' ,
39+ 'ZIP Code ' ,
40+ 'Country ' ,
41+ 'Phone ' ,
42+ 'Fax ' ,
43+ 'Email Address ' ,
44+ 'Ship To First Name ' ,
45+ 'Ship To Last Name ' ,
46+ 'Ship To Company ' ,
47+ 'Ship To Address ' ,
48+ 'Ship To City ' ,
49+ 'Ship To State ' ,
50+ 'Ship To ZIP Code ' ,
51+ 'Ship To Country ' ,
52+ 'Tax ' ,
53+ 'Duty ' ,
54+ 'Freight ' ,
55+ 'Tax Exempt ' ,
56+ 'Purchase Order Number ' ,
57+ 'MD5 Hash ' ,
58+ 'Card Code Response ' ,
59+ 'Cardholder Authentication Verification Response ' ,
60+ 'Account Number ' ,
61+ 'Card Type ' ,
62+ 'Split Tender ID ' ,
63+ 'Requested Amount ' ,
64+ 'Balance On Card '
65+ );
66+
67+ $ response = array ();
68+
69+ foreach ($ response_fields as $ field )
70+ {
71+ $ response [$ field ] = array_shift ($ temp );
72+ }
73+
74+ $ response_codes = array (
75+ 1 => 'Approved ' ,
76+ 2 => 'Declined ' ,
77+ 3 => 'Error ' ,
78+ 4 => 'Held for Review '
79+ );
80+
81+ $ avs_response_codes = array (
82+ 'A ' => 'Address (Street) matches, ZIP does not ' ,
83+ 'B ' => 'Address information not provided for AVS check ' ,
84+ 'E ' => 'AVS error ' ,
85+ 'G ' => 'Non-U.S. Card Issuing Bank ' ,
86+ 'N ' => 'No Match on Address (Street) or ZIP ' ,
87+ 'P ' => 'AVS not applicable for this transaction ' ,
88+ 'R ' => 'Retry?System unavailable or timed out ' ,
89+ 'S ' => 'Service not supported by issuer ' ,
90+ 'U ' => 'Address information is unavailable ' ,
91+ 'W ' => 'Nine digit ZIP matches, Address (Street) does not ' ,
92+ 'X ' => 'Address (Street) and nine digit ZIP match ' ,
93+ 'Y ' => 'Address (Street) and five digit ZIP match ' ,
94+ 'Z ' => 'Five digit ZIP matches, Address (Street) does not '
95+ );
96+
97+ $ response ['Response Code ' ] = $ response_codes [$ response ['Response Code ' ]];
98+ $ response ['AVS Response ' ] = $ avs_response_codes [$ response ['AVS Response ' ]];
99+
100+ $ this ->data = $ response ;
101101
102102 if (count ($ this ->data ) < 10 ) {
103103 throw new InvalidResponseException ();
0 commit comments