cancel
Showing results for 
Search instead for 
Did you mean: 

The operation has timed out

Hi

I had a request from a user of our software because of double charging their customer. What happened was that at 14:29:52.975 we send a authCaptureTransaction. At 14:30:23.236 we got a timeout exception ("The operation has timed out") . (It is the .net layer throwing this, but I cannot access this, since I'm using the Aut.net library)

The payment DID happen though, but I was informed of the timeout.
How can I extend the timeout from 30 seconds to 60 or 90?  We are using the library from nuget.

kind regards

Alexander

----------------------
Additional Comments: 14:29:52.975 Request transactionRequestType
----------------------
Field transactionType=authCaptureTransaction
Field amount=220
Field amountSpecified=True
14:30:23.236 ****************************** exception ******************************
14:30:23.236 WebException
14:30:23.236 The operation has timed out
14:30:23.236 at System.Net.HttpWebRequest.GetResponse()
at AuthorizeNet.Util.HttpUtility.PostData[TQ,TS](Environment env, TQ request)
at AuthorizeNet.Api.Controllers.Bases.ApiOperationBase`2.Execute(Environment environment)
at GOnline.Hardware.CreditCard.AuthorizeNetCreditCardProcessor.ProcessRequest(CreditCardInfo aCardInfo, transactionRequestType aRequest)

SMS-Timing
Member
6 REPLIES 6

Hi @SMS-Timing,

 

In Constants.cs, there's a "HttpConnectionTimeout" and a "HttpReadWriteTimeout" that can be changed. When you don't change it, the SDK falls back to the "HttpConnectionDeafultTimeout" and "HttpReadWriteDefaultTimeout" values, which are both 30 seconds.

 

Now, instead of extending the timeout, you might want to implement logic to handle the scenario of never getting the response back. Even if you extend the timeout to 90 minutes, that still doesn't help if the response packets got lost on their way back to you.

 

One thing we suggest is using the "invoiceNum" as a transaction identifier. Then, if you timeout on your end without a response, you can do a call to getUnsettledTransactionList and iterate through the list until you find a matching invoice number. If you find it, you can get the transaction ID and do a followup details call to get all the information you need. If you don't find it, you can be safe to retry the transaction.

Aaron
All Star

Hi Aaron

 

Sorry for my delayed answer.  I wasn't aware of it being accessible here.

 

How can I change values in the constants.cs file?  I'm using the nuget of Authorize.net.

 

Kind regards

 

Alexander

Hi @Gonline4Timing,

 

You should be able to just edit the Contants.cs file directly after installing.

For the .net SDK nuget package.  In the GitHub project for Authorize.net there is a way of increasing the timeout by adding 2 config settings in the web.config or app.config that will be read by the nuget package in your developed application.  They are as follows:

 

Your web.config settting of your application.

 

<add key="http.connectionTimeout" value="60000"/>

<add key="http.readWriteTimeout" value="60000"/>

 

If you do not provide them, they go to the default of 30 seconds each.

 

 

jbyte
Member

For the .net nuget package, your application needs to add 2 config settings to increase the timeout period.  They are as follows:

 

<add key="http.connectionTimeout" value="60000"/>

<add key="http.readWriteTimeout" value="60000"/>

 

The .net nuget package reads the config settings.  If they are not there, they use the default of 30 seconds (30,000 milliseconds)

jbyte
Member

Hello,

Did you have a fix on this issue? Facing same issue but no response from anyone and couldnt find this topic troubleshooting in google.  MyGiftCardSite

 

 

irvinj156
Member