贝宝沙盒使用的正确URL和参数是什么?

问题描述 投票:0回答:1

我正在使用一个名为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)
paypal paypal-sandbox paypal-rest-sdk nsoftware
1个回答
0
投票

永远不要对沙箱端点使用实时凭证,反之亦然,这将导致10002(无效凭证)

您的网址很好。您的问题是您要退还无效的ID。您的ID必须与您使用其凭据的实际PayPal Sandbox帐户上的实际PayPal Sandbox交易相对应,否则将因该错误而失败。

转到www.sandbox.paypal.com,以沙盒用户(非实时用户)登录,并确认您能够实际找到您要退款的交易ID。

© www.soinside.com 2019 - 2024. All rights reserved.