Hey folks, once again I'm coming here scratching my head, the frustrating part is over but now it's a bit of a confusing part...
You see, it almost appears as though the Relay Response data coming back from Authorize.Net is coming back in a haphazard manner...
Here's the error log of the response:
WARN [2012-12-17 16:17:54,578] - Request: 2 WARN [2012-12-17 16:17:54,578] - Request: 2 WARN [2012-12-17 16:17:54,578] - Request: This transaction has been declined. WARN [2012-12-17 16:17:54,578] - Request: P WARN [2012-12-17 16:17:54,578] - Request: 000000 WARN [2012-12-17 16:17:54,578] - Request: 4871828852 WARN [2012-12-17 16:17:54,578] - Request: CC WARN [2012-12-17 16:17:54,578] - Request: Visa WARN [2012-12-17 16:17:54,578] - Request: XXXX1111 WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: 221 WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: auth_capture WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: 30.00 WARN [2012-12-17 16:17:54,578] - Request: 0.00 WARN [2012-12-17 16:17:54,578] - Request: 0.00 WARN [2012-12-17 16:17:54,578] - Request: 0.00 WARN [2012-12-17 16:17:54,578] - Request: FALSE WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: A1FD72EF228AF86D2E37AEE258D838AE WARN [2012-12-17 16:17:54,578] - Request: P WARN [2012-12-17 16:17:54,578] - Request: WARN [2012-12-17 16:17:54,578] - Request: false WARN [2012-12-17 16:17:54,578] - Request: Pay Now
Yes they're all warnings by design while I debug this so they stand out, eventually I'll remove it.
Now then, There are a few things I'd like to point out, one:
The Invoice number is 221, see it there smack-dab in the middle? Yeah, that's supposed to be number 8, clearly it's not.
Second:
The Message is number 3 (Otherwise known as response reason text that is supposed to be in slot 4)
As you can see, those two clear examples are easy to identify, the Pay Now is just the submit button, not actually part of the API return but clearly it's passing it at the end and it's not alpha-sorted somehow because there are other 'P's in there.
From the prior problem page, here's the response setter:
var response = new AuthorizeNet.GatewayResponse(Request.Form.ToDictionary().Values.ToArray());
Convoluted I know but it was the only way to get a string[] out of the Request.
And this is what's generating the warnings for debugging:
foreach (var arrayval in Request.Form.ToDictionary().Values.ToArray()){ log.Warn("Request: " + arrayval); }
So as you can see, it's using the same logic to generate both, and that logic must be flawed somehow, why might my response be quirky like this?
Solved! Go to Solution.
12-17-2012 02:39 PM
You only need the Gateway Response if you use AIM because the result from AIM are like
1,1,1,This transaction has been approved.,tt9ieF,Y,2149207083,,,1.00,CC,auth_capture,,,,,,,,,,,,,,,,,,,,,,,,,,DE9F3FAD313D32144FA7EDF4B27CCE02,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,merchant defined field 1,merchant defined field 2
12-18-2012 07:38 AM
Relay Response use field name/value pair and might not be in sequence. The only sequence/delimited results are from AIM.
the field names from SIM are
You can get to the result like
string response_code = Request.Form["x_response_code"];
12-17-2012 03:33 PM
That appears to work fine; however, that's not how GatewayResponse reads the response strangely enough, and that's straight from ANET (It uses indexes).
I don't necessarily want to overhaul the entire GatewayResponse function if I don't have to in order to produce the correct response, but if that's the only option then so be it...
12-18-2012 07:22 AM
You only need the Gateway Response if you use AIM because the result from AIM are like
1,1,1,This transaction has been approved.,tt9ieF,Y,2149207083,,,1.00,CC,auth_capture,,,,,,,,,,,,,,,,,,,,,,,,,,DE9F3FAD313D32144FA7EDF4B27CCE02,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,merchant defined field 1,merchant defined field 2
12-18-2012 07:38 AM
Alright there, I guess there's no nice way to dress this up in C#, silly 'special' name value pair systems...
Thanks again RaynorC1emen7, you're a coding saint :D
12-18-2012 10:17 AM