Authorize.Net
Advanced Implementation Method (AIM)
PHP Example Code


This is just a test to:
1) post an HTTP request to the secure Authorize.Net server
2) process feedback from the secure Authorize.Net transaction DLL


01: Post the transaction (see the code for specific information):

02: Get post results:
3|1|103|This transaction cannot be accepted.||P|0|||12.23|CC|auth_capture||||||||||||||||||||||||||719B68C65CAA43CA71CE839D9EEA1F3E|||||||||||||||||||||||||||||||FALSE|Customer Birth Month: 12|Customer Birth Day: 1|Customer Birth Year: 1959|Promotion: Spring Sale

03: Parse post results (simple approach)
     3
     1
     103
     This transaction cannot be accepted.
     P
     0
     12.23
     CC
     auth_capture
     719B68C65CAA43CA71CE839D9EEA1F3E
     FALSE
     Customer Birth Month: 12
     Customer Birth Day: 1
     Customer Birth Year: 1959
     Promotion: Spring Sale

04: Parse the results string into individual, meaningful segments:
Length of the returned string from Authorize.Net:263
Number of delimiter characters in the returned string:72
Response Code: Error
Response Subcode: 1
Response Reason Code: 103
Response Reason Text: This transaction cannot be accepted.
Approval Code: NO VALUE RETURNED
AVS Result Code: P
Transaction ID: 0
Invoice Number (x_invoice_num): NO VALUE RETURNED
Description (x_description): NO VALUE RETURNED
Amount (x_amount): 12.23
Method (x_method): CC
Transaction Type (x_type): auth_capture
Customer ID (x_cust_id): NO VALUE RETURNED
Cardholder First Name (x_first_name): NO VALUE RETURNED
Cardholder Last Name (x_last_name): NO VALUE RETURNED
Company (x_company): NO VALUE RETURNED
Billing Address (x_address): NO VALUE RETURNED
City (x_city): NO VALUE RETURNED
State (x_state): NO VALUE RETURNED
ZIP (x_zip): NO VALUE RETURNED
Country (x_country): NO VALUE RETURNED
Phone (x_phone): NO VALUE RETURNED
Fax (x_fax): NO VALUE RETURNED
E-Mail Address (x_email): NO VALUE RETURNED
Ship to First Name (x_ship_to_first_name): NO VALUE RETURNED
Ship to Last Name (x_ship_to_last_name): NO VALUE RETURNED
Ship to Company (x_ship_to_company): NO VALUE RETURNED
Ship to Address (x_ship_to_address): NO VALUE RETURNED
Ship to City (x_ship_to_city): NO VALUE RETURNED
Ship to State (x_ship_to_state): NO VALUE RETURNED
Ship to ZIP (x_ship_to_zip): NO VALUE RETURNED
Ship to Country (x_ship_to_country): NO VALUE RETURNED
Tax Amount (x_tax): NO VALUE RETURNED
Duty Amount (x_duty): NO VALUE RETURNED
Freight Amount (x_freight): NO VALUE RETURNED
Tax Exempt Flag (x_tax_exempt): NO VALUE RETURNED
PO Number (x_po_num): NO VALUE RETURNED
MD5 Hash: 719B68C65CAA43CA71CE839D9EEA1F3E
Card Code Response: NO VALUE RETURNED
Reserved (40): NO VALUE RETURNED
Reserved (41): NO VALUE RETURNED
Reserved (42): NO VALUE RETURNED
Reserved (43): NO VALUE RETURNED
Reserved (44): NO VALUE RETURNED
Reserved (45): NO VALUE RETURNED
Reserved (46): NO VALUE RETURNED
Reserved (47): NO VALUE RETURNED
Reserved (48): NO VALUE RETURNED
Reserved (49): NO VALUE RETURNED
Reserved (50): NO VALUE RETURNED
Reserved (51): NO VALUE RETURNED
Reserved (52): NO VALUE RETURNED
Reserved (53): NO VALUE RETURNED
Reserved (54): NO VALUE RETURNED
Reserved (55): NO VALUE RETURNED
Reserved (56): NO VALUE RETURNED
Reserved (57): NO VALUE RETURNED
Reserved (58): NO VALUE RETURNED
Reserved (59): NO VALUE RETURNED
Reserved (60): NO VALUE RETURNED
Reserved (61): NO VALUE RETURNED
Reserved (62): NO VALUE RETURNED
Reserved (63): NO VALUE RETURNED
Reserved (64): NO VALUE RETURNED
Reserved (65): NO VALUE RETURNED
Reserved (66): NO VALUE RETURNED
Reserved (67): NO VALUE RETURNED
Reserved (68): NO VALUE RETURNED
Merchant-defined (69): : FALSE
Merchant-defined (70): : Customer Birth Month: 12
Merchant-defined (71): : Customer Birth Day: 1
Merchant-defined (72): : Customer Birth Year: 1959
Merchant-defined (73): : Promotion: Spring Sale


04: Done.