jadamson Posted July 23, 2004 Posted July 23, 2004 (edited) This Thread explains how to parse the $response variable coming from Authorize.net in Test mode. I was getting the "There was an error processing your credit card ():" so I came up with this little tool for debugging and it only take about five minutes. Find in authorize_direct.php. It is the last line in file. $response = split(",", $authorize); and paste the following code under it. ? for ($i=0, $n=sizeof($response); $i<$n; $i++) { ? ? ? $log = fopen("trans.log", "a"); ? ? ? fwrite($log, "Position ".($i + 1)." ".$response[$i]."\n"); ? ? ? fclose($log); ? } Create "trans.log" file, and place it in the catalog folder. Set trans.log chmod 777. Perform a transaction. If cURL is working properly, you will have data in your trans.log file. If not, cURL is not working. The trans.log will contain read response codes, response reason codes, and response reason text as it is stated in the AIM Implementation Guide here: http://www.authorizenet.com/support/AIM_guide.pdf Refer to the "Fields in the Gateway Response" in the Aim Implemetation Guide. These "Position in Response" fields are in the "trans.log". Then cross reference these codes with the "Response Code Details" also listed in the AIM Guide. Example: The Position values in my log file were: Position 1 3Position 2 1Position 3 103Position 4 This transaction cannot be accepted.Position 5 Position 6 PPosition 7 0Position 8 103Position 9 103Position 10 14.00and so on.... What it means: Position 1 3 - Position 1 is your "Response code".Position 2 1 - A code used by the system for internal transaction tracking.Position 3 103 - Position 3 is a "Response Reason Code".Take Notice of Position1 and Position3. In the Aim Guide under "Response Reason Codes & Response Reason Text", look up the Position 1 value ("Response Code") where Position 3 ("Response Reason Code") is 103. The error is: "A valid fingerprint, transaction key, or password is required for this transaction."So there you have it. Now you can find out if cURL is working and at the same time evaluate the Authorize.net Response. One other helpful hint. If you are using a "Transaction Key" use the "x_Trans_Key" variable to pass it to Authorize.net. If you are using your Gateway Password, use the "x_password" variable. You only need one or the other. This was confusing to me. I was creating a "Transaction Key" in the Gateway but using x_Trans_Key = "My Password" in the script and that was causing problems. I spoke with Authorize.net and they said they are not the same. Hope this is helpful. Jeff Edited July 23, 2004 by jadamson Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.