【问题标题】:What is the correct URL and parameters to use for the PayPal Sandbox?用于 PayPal 沙盒的正确 URL 和参数是什么?
【发布时间】:2020-06-16 06:49:39
【问题描述】:

我正在使用一个名为 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】:

    永远不要将实时凭据与沙盒端点一起使用,反之亦然,这将导致 10002(无效凭据)

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

    转到https://www.sandbox.paypal.com,使用沙盒用户名和密码登录(这不是实时用户名和密码,也不是沙盒API用户名或沙盒API密码,以防您不清楚) ,并确认您确实能够找到您要退款的交易 ID。

    【讨论】:

    • 谢谢,这很有帮助。我猜这个代码使用的“付款号码”来自实时系统,所以我们无法退款,因为它不在沙箱中。我有这个权利吗?所以为了测试这一点,我需要在沙箱中支付一笔款项,然后尝试退款,对吗?
    • 没错,live和sandbox环境是完全分开的,所以你不能在sandbox中退还live ID
    猜你喜欢
    • 2011-12-16
    • 1970-01-01
    • 2016-05-23
    • 2016-11-01
    • 2011-09-08
    • 2016-01-24
    • 2014-10-03
    • 2019-08-01
    • 2016-05-04
    相关资源
    最近更新 更多