I see other posts on this message board asking why they are receiving duplicate transaction error messages.
I have the opposite problem. I don't get the message when I expect to.
I use AIM, and every now and then, I post a transaction request, but don't receive a response before a 30 second timeout period. As a result, I don't know if Authorize.net received the request, authorized it or denied it.
My code handles this exception by resubmitting the exact same request (containing the x_duplicate_window field with a 2 minute value) and checking for the duplicate transaction response. If it receives the duplicate transaction response, it returns back the authorization data from the initial transaction. If it doesn't receive the duplicate transaction response, it processes the response as if it were the initial response.
In testing, when I force the timeout exception and the identical transaction gets resubmitted, I don't receive the duplicate transaction response, even though I see in the administrative interface that the first transaction successfully authorized. As a result, the card gets double charged.
Here is some psuedo code:
My problem is that, even though the first post's transaction gets authorized, the reponse code and reason code response from the second post both contain the value 1, instead of 3 and 11 as I expect.
I've tried adding a 30 second delay between the firsts and second posts thinking it may take Authorize.net a little while to "see" the first transaction, but that didn''t help.
Can anyone offer any other suggestions?
Thanks,
Steve
Solved! Go to Solution.
10-02-2011 01:11 PM
How about just submit the same transaction twice in a row in code, without the fake timeout exception and see if you get 2 transaction on the administrative interface. Can you also show us your all your code.
If that still get duplicate transaction, it will be time to call support to have them look at it.
10-03-2011 11:51 AM
It all the fields the same? Here is the list
10-02-2011 03:18 PM
Yes, the fields are identical.
10-02-2011 08:25 PM
Is the timeout on Authorize.net's end or yours? Would it help to go into your PHP.ini and configure a larger timeout value?
10-02-2011 10:36 PM
The timeout value is mine. I set x_duplicate_window to 120 seconds.
10-03-2011 06:43 AM
How about just submit the same transaction twice in a row in code, without the fake timeout exception and see if you get 2 transaction on the administrative interface. Can you also show us your all your code.
If that still get duplicate transaction, it will be time to call support to have them look at it.
10-03-2011 11:51 AM
RaynorC1emen7,
I tried your suggestion and submitted the same transaction twice in a row. Here is the code:
Response.CommaText := HTTPClient.Post('https://secure.authorize.net/gateway/transact.dll', Request);
Response.CommaText := HTTPClient.Post('https://secure.authorize.net/gateway/transact.dll', Request);
Then I went to the administrative interface and saw that there were indeed two transactions.
At first glance, they appeared identical. After closer inspection, however, a space in one of the fields got URL encoded to a %20 in the second request.
It seems that the HTTPClient.Post call modified the Request variable, so when I used it a second time, it wasn't identical.
I adjusted the code to preserve the value of the original Request varaible and used the copy on the second HTTPClient.Post call.
Now everything works as expected.
Thanks everyone for your very helpful suggestions.
Steve
10-03-2011 06:32 PM