Я использовал следующий код (vb.Net-3.5) в Sandbox в течение 2 месяцев без проблем , Теперь он вызывает ошибку: Подключенное соединение было закрыто: произошла непредвиденная ошибка при отправкеИспользование PayPal PDT с vb.net и получение: базовое соединение было закрыто: произошла непредвиденная ошибка при отправке
Любые идеи о том, что нужно сделать, чтобы заставить его работать снова.
Может ли это иметь какое-либо отношение к изменениям, которые PayPal реализует в SSL-сертификатах в Песочнице. Это началось после 1/18/2016. Я нашел эту статью о PayPal SSL сертификата обновления https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1766
Imports System
Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Collections.Generic
Imports System.Object
Imports System.Web
Imports System.Web.Configuration
Imports System.Web.Security
Imports System.Data
Imports System.Data.SqlClient
Imports System.Exception
Imports System.SystemException
Imports System.Threading.ThreadAbortException
Partial Class Payment
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
' This is the initial start of program
Dim QString As String = ""
Dim parcelID As String = ""
Dim txID As String = ""
' Get Query string Variables
QString = Request.ServerVariables("QUERY_STRING")
parcelID = Request.QueryString("item_number")
txID = Request.QueryString("tx")
Try
If Not String.IsNullOrEmpty(txID) Then
' Create a request using a URL that can receive a post.
' Sandbox Version
Dim PayPalWeb As String = "https://www.sandbox.paypal.com/cgi-bin/webscr"
Dim PayPalID As String = "***********************************************************"
' Live Version
'Dim PayPalWeb As String = "https://www.paypal.com/cgi-bin/webscr"
'Dim PayPalID As String = ""
Dim PayPalRequest As WebRequest
' Create POST data and convert it to a byte array.
Dim postData As String = "cmd=_notify-synch" + _
"&tx=" + txID + _
"&at=" + PayPalID + _
"&submit = PDT"
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
Dim dataStream As Stream
PayPalRequest = WebRequest.Create(PayPalWeb)
' Set the Method property of the request to POST.
PayPalRequest.Method = "POST"
' Set the ContentType property of the WebRequest.
PayPalRequest.ContentType = "application/x-www-form-urlencoded"
' Set the ContentLength property of the WebRequest.
PayPalRequest.ContentLength = byteArray.Length
' Get the request stream.
dataStream = PayPalRequest.GetRequestStream() ' <===== Fails on this call
' Write the data to the request stream.
dataStream.Write(byteArray, 0, byteArray.Length)
' Close the Stream object.
dataStream.Close()
' Get the response.
Dim PayPalResponse As WebResponse = PayPalRequest.GetResponse()
' Get the stream containing content returned by the server.
dataStream = PayPalResponse.GetResponseStream()
' Open the stream using a StreamReader for easy access.
Dim reader As New StreamReader(dataStream)
' Read the content.
Dim responseFromServer As String = reader.ReadToEnd()
' Clean up the streams.
reader.Close()
dataStream.Close()
PayPalResponse.Close()
.......
Может ли это иметь какое-либо отношение к изменениям, которые PayPal реализует на защищенных сертификатах в песочнице. Это началось после 1/18/2016. Я нашел эту статью о обновлении сертификата PayPal. Https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1766 – Corinne