我正在使用一个名为 PayPal Integrator 2016 .NET Edition 的程序。它已经在我们的应用程序中使用了多年,我们只是注意到我们无法通过 PayPal 沙箱退款。实时系统中的退款通过,但在沙箱中,我们得到一个错误。看起来 PayPal 沙盒 URL 已更改,但我尝试过的 URL 均无效。你能告诉我如何让它工作吗?
我从该站点获得了 URL:https ://www.nsoftware.com/kb/xml/07291101.rst 。我还尝试了此页面上提到的 URL:https ://developer.paypal.com/docs/api/sandbox/ 。
对于凭证,我尝试了与我们的 PayPal 帐户关联的实时凭证和沙盒凭证。我还尝试以我的名义创建一个新的开发人员帐户并在那里使用沙盒凭据。
以下是我尝试过的 URL、我使用的凭据以及收到的错误消息。
实时凭据
https://api.sandbox.paypal.com/nvp Connection closed.
https://api-3t.sandbox.paypal.com/nvp [10002] Security error. Security header is not valid.
https://sandbox.paypal.com/nvp [10002] Security error. Security header is not valid.
沙盒凭据(与实时凭据相同的帐户)
https://api.sandbox.paypal.com/nvp Connection closed.
https://api-3t.sandbox.paypal.com/nvp [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.
https://sandbox.paypal.com/nvp [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.
沙盒凭据(新开发者帐户)
https://api.sandbox.paypal.com/nvp Connection closed.
https://api-3t.sandbox.paypal.com/nvp [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.
https://sandbox.paypal.com/nvp [10011] Invalid transaction id value. Transaction refused because of an invalid transaction id value.
这是我使用的代码。我使用上面列出的名称更改了 URL、用户等。
Dim ppRefund As New nsoftware.InPayPal.Refundtransaction()
Call ppRefund.Reset()
ppRefund.About = ""
ppRefund.InvokeThrough = Nothing
ppRefund.Timeout = 180
ppRefund.URL = PAYPAL_URL
ppRefund.User = PAYPAL_USERID
ppRefund.Password = PAYPAL_PASSWORD
ppRefund.Signature = PAYPAL_SIGNATURE
ppRefund.Amount = RefTrans.AmountTotal
ppRefund.RefundType = nsoftware.InPayPal.RefundtransactionRefundTypes.rtPartial
ppRefund.CurrencyCode = "USD"
ppRefund.Memo = "Credit PayPal Trans ID: " & RefTrans.Payment.payment_nbr
ppRefund.Refund(RefTrans.Payment.payment_nbr)