DoExpressCheckoutPayment processes payment and then times out

jezzb

New Member
After getting the token and payerID from SetExpressCheckOut now I'm looking to actually get the money from the user.Using the code generated by the paypal function wizard, I'm calling the ConfirmPayment function.The problem is that the function is called successfully and processes the payment from the user, but then I received a timeout error. So I get their money, and the user gets a time out page. Not the best way to keep customers.\[code\]The operation has timed outDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The operation has timed outSource Error: Line 313:Line 314: //Retrieve the Response returned from the NVP API call to PayPal**Line 315: HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();**Line 316: string result;Line 317: using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))\[/code\]I get a timeout on line 315 which originates from the paypal function's HTTPCall function.public string HttpCall(string NvpRequest) //CallNvpServer { string url = pendpointurl;\[code\] //To Add the credentials from the profile string strPost = NvpRequest + "&" + buildCredentialsNVPString(); strPost = strPost + "&BUTTONSOURCE=" + HttpUtility.UrlEncode( BNCode ); HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Timeout = Timeout; objRequest.Method = "POST"; objRequest.ContentLength = strPost.Length; //Retrieve the Response returned from the NVP API call to PayPal **HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();** (Line 315) string result; using (StreamReader sr = new StreamReader(objResponse.GetResponseStream())) { result = sr.ReadToEnd(); } return result;}\[/code\]I feel this maybe something with Paypal's server but either ways, it doesn't work and will piss off users if it goes to live. Do you guys have any idea why it would time out all of a sudden? The same HTTPCall is used in SetExpressCheckOut before and works fine.
 
Back
Top