Jump to content


Sandbox Express Checkout In Dot Net Throws Exception

  • Please log in to reply
No replies to this topic

#1 Jitendra



  • Members
  • Pip
  • 1 posts

Posted 20 February 2016 - 08:26 AM

I am using the sandbox API - https://api-3t.sandbox.paypal.com/nvpfor express chekout. 


Below is the Httprequest code:


 public string HttpCall(string NvpRequest) //CallNvpServer
string strPost = NvpRequest + "&" + buildCredentialsNVPString();
strPost = strPost + "&BUTTONSOURCE=" + HttpUtility.UrlEncode(BNCode);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Timeout = Timeout;
objRequest.Method = "POST";
objRequest.ContentLength = strPost.Length;
 using (Stream stm = objRequest.GetRequestStream())
         using (StreamWriter sw = new StreamWriter(stm))


The strPost value in the above code is -
&USER=<my sandbox API userName>
&PWD=<my sandbox API password>
&SIGNATURE=<my sandbox API signature>
I get the exception at the line Stream stm = objRequest.GetRequestStream(), it throws the exception "Received an unexpected EOF or 0 bytes from the transport stream". 

I tried using  ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; before creating the request, but it did not resolve the issue. Settings objRequest.Credentials and objRequest.ProxyCredentials also didn't help.


Please help.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users