I am using the PayPalStandard NopCommerce plugin. When I placed an order and paid for a paid plug-in after successful payment on PayPal, it is redirected to the merchants website. At this time, he gives an error:
The request was aborted: Failed to create a secure SSL / TLS channel.
I also use the Sandbox account for Paypal for testing.
It throws an error from this line:
var sw = new StreamWriter(req.GetRequestStream()
Here is the code below:
var req = (HttpWebRequest)WebRequest.Create(GetPaypalUrl()); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ProtocolVersion = HttpVersion.Version10; string formContent = string.Format("cmd=_notify-synch&at={0}&tx={1}", _paypalStandardPaymentSettings.PdtToken, tx); req.ContentLength = formContent.Length; using (var sw = new StreamWriter(req.GetRequestStream(), Encoding.ASCII)) sw.Write(formContent);
source share