c# - Paypal Express Checkout: Error 10001 Timeout -
so i'm trying implement paypal express checkout , keep recieving above error.
my nv follows:
method=setexpresscheckout& version=204.0& user=mylogicn& pwd=mypwd& signature=mysignature& paymentrequest_0_amt=26.65& paymentrequest_0_currencycode=gbp& returnurl=https://www.example.com/basket/notificationprocessor.ashx?type=paypalsuccess& cancelurl=https://www.example.com/basket/notificationprocessor.ashx?type=paypalfailure& paymentrequest_0_paymentaction=sale
obviously information changed. can't find particularly wrong request without fail returns 10001, timeout processing request.
i'm hoping here has encountered before , has solution.
edit: here's code puts request , retrieves response:
string[][,] nv = new string[11][,] { new string[,]{{"method", "setexpresscheckout" }}, new string[,]{{"version", "204.0" }}, new string[,]{{"user", "myuser"}}, new string[,]{{"pwd", "mypwd"}}, new string[,]{{"signature","mysig"}}, new string[,]{{"paymentrequest_0_amt", "26.65"}}, new string[,]{{"paymentrequest_0_currencycode","gbp"}}, new string[,]{{"returnurl", "https://www.example.com/basket/notificationprocessor.ashx?type=paypalsuccess"}}, new string[,]{{"cancelurl", "https://www.example.com/basket/notificationprocessor.ashx?type=paypalfailure"}}, new string[,]{{"paymentrequest_0_paymentaction", "sale"}}, new string[,]{{"noshipping", "1"}}, }; string q = "?"; foreach(string[,] s in nv) { q += s[0,0] + "=" + s[0,1] + "&"; } q = q.trimend('&'); httpwebrequest req = (httpwebrequest)webrequest.create("https://api-3t.sandbox.paypal.com/nvp" + q); req.method = "post"; httpwebresponse response = (httpwebresponse)req.getresponse(); var encoding = asciiencoding.ascii; if (response.statuscode == httpstatuscode.ok) { using (var reader = new system.io.streamreader(response.getresponsestream(), encoding)) { string response = reader.readtoend(); } }
and paypals response:
timestamp=2016%2d07%2d11t11%3a10%3a55z& correlationid=dcd0f848a9bb9& ack=failure& l_errorcode0=10001& l_shortmessage0=internal%20error& l_longmessage0=timeout%20processing%20request
error 10001 unhandled exception means there's no better error message available.
as per paypal documentation
you must encode request field values in request paypal , decode field values in response. must encode , decode individual values; do not encode or decode entire message. browsers attempt encode , decode messages redirected or them; however, must verify encoding , decoding done correctly , field values.
it might happen due encoding. try rid of , see if helps.
Comments
Post a Comment