您好,我已经实施了Paypal发票,快速结账&使用自适应方法(NVP)调用的定期付款服务。它在我的本地系统上使用沙箱帐户正常工作,但在开发服务器上没有,并且在我根据请求调用paypal服务的任何地方都面临问题。
InvoiceModelAlias.PaymentTermsType paymentTermsType = (InvoiceModelAlias.PaymentTermsType)Enum.Parse(typeof(InvoiceModelAlias.PaymentTermsType),invoice.PaymentTerms.ToUpper());
InvoiceModelAlias.CreateAndSendInvoiceRequest invoiceRequest = new InvoiceModelAlias.CreateAndSendInvoiceRequest();
invoiceRequest.requestEnvelope = new InvoiceModelAlias.RequestEnvelope();
invoiceRequest.requestEnvelope.errorLanguage = "en_US";
invoiceRequest.invoice = new InvoiceModelAlias.InvoiceType();
invoiceRequest.invoice.currencyCode = invoice.CurrencyCode;
invoiceRequest.invoice.merchantEmail = invoice.MerchantEmail;
invoiceRequest.invoice.payerEmail = invoice.PayerEmail;
invoiceRequest.invoice.paymentTerms = paymentTermsType;
invoiceRequest.invoice.itemList = new InvoiceModelAlias.InvoiceItemListType();
invoiceRequest.invoice.itemList.item = new List<InvoiceModelAlias.InvoiceItemType>();
invoiceRequest.invoice.itemList.item.Add(new InvoiceModelAlias.InvoiceItemType(invoice.ItemName, Convert.ToDecimal(invoice.ItemQuantity), Convert.ToDecimal(invoice.ItemAmount)));
InvoiceAlias.InvoiceService invoiceService;
InvoiceModelAlias.CreateAndSendInvoiceResponse invoiceResponse = null;
invoiceService = GetService();
invoiceResponse = invoiceService.CreateAndSendInvoice(invoiceRequest);
string ackRsponse = invoiceResponse.responseEnvelope.ack.ToString();
invoiceService.CreateAndSendInvoice(invoiceRequest)
PayPal.Exception.ConnectionException: Invalid HTTP response The underlying connection was closed: An unexpected error occurred on a receive.
at PayPal.HttpConnection.Execute(String payLoad, HttpWebRequest httpRequest)
at PayPal.APIService.MakeRequestUsing(IAPICallPreHandler apiCallHandler)
at PayPal.BasePayPalService.Call(IAPICallPreHandler apiCallHandler)
at PayPal.Invoice.InvoiceService.CreateAndSendInvoice(CreateAndSendInvoiceRequest createAndSendInvoiceRequest, String apiUserName)
at PayPal.Invoice.InvoiceService.CreateAndSendInvoice(CreateAndSendInvoiceRequest createAndSendInvoiceRequest)
at DoPayments.Payments.Invoices.CreateAndSendInvoice(Invoice invoice)
请问有人帮我解决这个问题或者说明这背后的原因,因为它在本地运行良好但在开发/生产服务器上没有。
我在面对快速结账和定期付款方式时遇到的同样问题如下:
com.paypal.sdk.exceptions.FatalException: The underlying connection was closed: An unexpected error occurred on a receive.
at com.paypal.sdk.core.nvp.NVPAPICaller.Call(String NvpRequest)
at com.paypal.sdk.services.NVPCallerServices.Call(String requestnvp)
提前致谢。