试图第一次进行masspay并收到错误。

时间:2013-04-24 18:45:54

标签: paypal masspay

我正在尝试创建虚拟请求以进行群发付款并遇到麻烦。支付宝正在崩溃并将其归还。

com.paypal.sdk.exceptions.TransactionException:基础连接已关闭:接收时发生意外错误。 ---> System.Reflection.TargetInvocationException:调用目标抛出了异常。 ---> System.Net.WebException:基础连接已关闭:接收时发生意外错误。 ---> System.IO.IOException:无法从传输连接读取数据:远程主机强制关闭现有连接。 ---> System.Net.Sockets.SocketException:System.Net.Sockets.NetworkStream.Read(Byte []缓冲区,Int32偏移量,Int32大小)远程主机强制关闭现有连接---内部异常堆栈跟踪结束 - - 在System.Net.Security的System.Net.FixedSizeReader.ReadPacket(Byte []缓冲区,Int32偏移量,Int32计数)的System.Net.Sockets.NetworkStream.Read(Byte []缓冲区,Int32偏移量,Int32大小)处System.Net.Security上System.Net.Security._SslStream.StartReading(Byte []缓冲区,Int32偏移量,Int32计数,AsyncProtocolRequest asyncRequest)的._SslStream.StartFrameHeader(Byte []缓冲区,Int32偏移量,Int32计数,AsyncProtocolRequest asyncRequest) System.Net.PooledStream.Read(Byte [System.Net.TlsStream.Read(Byte [] buffer,Int32 offset,Int32 size)的._SslStream.ProcessRead(Byte []缓冲区,Int32偏移量,Int32计数,AsyncProtocolRequest asyncRequest) System.Net.Connection.SyncRead上的缓冲区,Int32偏移量,Int32大小)(HttpWebRequest请求,布尔userRetrievedStream,布尔值probeRead)---内部异常堆栈跟踪结束---在System.Web上的System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest请求),System.Web上的System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest请求) com.paypal.soap.api.PayPalAPISoapBinding.MassPay(MassPayReq MassPayReq)中的.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName,Object []参数)---内部异常堆栈跟踪的结束---在System.RuntimeMethodHandle。 _InvokeMethodFast(Object target,Object []参数,SignatureStruct& System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags)中的System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags invokeAttr,Binder binder,Object []参数,CultureInfo culture,Boolean skipVisibilityChecks)中的sig,MethodAttributes methodAttributes,RuntimeTypeHandle typeOwner) com.paypal.sdk.core.soap.SOAPAPICaller.CallSOAP(MethodInfo方法,Object obj,Object [] args) - 内部异常堆栈跟踪结束 - invokeAttr,Binder binder,Object []参数,CultureInfo文化) - 在com.paypal.sdk.core.soap.SOAPAPICaller.CallSOAP(MethodInfo方法,Object obj,Object [] args)中,位于StorkBrokers的com.paypal.sdk.core.soap.SOAPAPICaller.Call(String operationName,AbstractRequestType请求) masspaytest.aspx.vb中的.masspaytest.Page_Load(Object sender,EventArgs e):第86行

这是我的代码的样子。有人可以告诉我我做错了什么:   Dim MassPayReqItem作为新的MassPayRequestItemType         MassPayReqItem.Amount = New BasicAmountType         MassPayReqItem.Amount.currencyID = CurrencyCodeType.USD         MassPayReqItem.Amount.Value = 15.0         MassPayReqItem.Note =“测试质量支付”         MassPayReqItem.ReceiverEmail =“user@email.com”

    Dim MassPayReqItem1 As New MassPayRequestItemType
    MassPayReqItem1.Amount = New BasicAmountType
    MassPayReqItem1.Amount.currencyID = CurrencyCodeType.USD
    MassPayReqItem1.Amount.Value = 5.0
    MassPayReqItem1.Note = "test mass payment1"
    MassPayReqItem1.ReceiverEmail = "user1@email.com"


    Dim massPayItemsArray(1) As MassPayRequestItemType
    massPayItemsArray.SetValue(MassPayReqItem, 0)
    massPayItemsArray.SetValue(MassPayReqItem1, 1)


    Dim MassPayReqType As New MassPayRequestType
    MassPayReqType.MassPayItem = massPayItemsArray
    MassPayReqType.Version = "51.0"
    MassPayReqType.EmailSubject = "Mass Payment from  from me " _
    & Date.Now.ToLongTimeString


    Dim profile As IAPIProfile = ProfileFactory.createSignatureAPIProfile()



    Dim caller As New com.paypal.sdk.services.CallerServices()

    profile.APIUsername = "fsadsfdafsdasfad1.gmail.com"
    profile.APIPassword = "fafsdafafaddsaf"
    profile.APISignature = "Alq1UN0gL5pSkR-311R7KRCKujzNfdsaasgasgsagsagcOvcvz-hn5Rd"

    caller.APIProfile = profile

    Try
        'send request, return response

        Dim MPRes As New MassPayResponseType
        MPRes = DirectCast(caller.[Call]("MassPay", MassPayReqType), MassPayResponseType)



        Select Case MPRes.Ack

            Case AckCodeType.Success

                Response.Write("API response: <b>" & MPRes.Ack.ToString _
                & "</b><br> Timestamp: <b>" & MPRes.Timestamp.ToLongTimeString _
                & "</b><br> Version: <b>" & MPRes.Version.ToString)

            Case Else
                Response.Write("API response: <b>" & MPRes.Ack.ToString _
                & "</b><br> Timestamp: <b>" & MPRes.Timestamp.ToLongTimeString _
                & "</b><br> Version: <b>" & MPRes.Version.ToString _
                & "</b><br> Error code: <b>" & MPRes.Errors(0).ErrorCode _
                & "</b><br> Short error: <b>" & MPRes.Errors(0).ShortMessage _
                & "</b><br> Long error: <b>" & MPRes.Errors(0).LongMessage)

        End Select

    Catch ex As Exception

        Response.Write(ex.ToString)

    End Try

0 个答案:

没有答案
相关问题