【问题标题】:PayPal Refund API Operation getting error 520002PayPal 退款 API 操作出现错误 520002
【发布时间】:2016-06-06 21:57:14
【问题描述】:

我正在尝试用 bash 编写部分退款贝宝交易的代码。这是我关注的指南https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/,但我收到了 520002 错误消息。在之前的请求中,我看到需要指定receiverList.receiver(0).email,但它仍然无法正常工作。 这是我的请求的样子:

curl -s --insecure
-H "X-PAYPAL-SECURITY-USERID: api_username" 
-H "X-PAYPAL-SECURITY-PASSWORD: api_password" 
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature" 
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV" 
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: your_app_id "          
https://svcs.sandbox.paypal.com/AdaptivePayments/Refund  -d  
"requestEnvelope.errorLanguage=en_US 
&requestEnvelope.detailLevel=ReturnAll
&transactionId=xxxxxxxxxx
&receiverList.receiver(0).email=xxxxxxxx
&currencyCode=EUR
&receiverList.receiver(0).amount=44.00"

有人知道怎么解决吗?

【问题讨论】:

  • 您可以尝试删除“transactionId”参数,并添加“payKey”参数吗?将“payKey”参数设置为用于原始支付的paykey
  • 请提供完整的 API 响应以供进一步研究。另外,请确保交易是自适应支付交易,而不是快速结账交易或标准交易。
  • 嗨,赵,我们已经为交易实施了快速结账。那么用于退款的东西不能正常工作?您能帮我弄清楚要遵循的正确指南吗?非常感谢您的帮助。
  • 如果交易是Express checkout支付,需要使用该API进行退款:developer.paypal.com/docs/classic/api/merchant/…

标签: paypal paypal-sandbox paypal-adaptive-payments


【解决方案1】:

我认为您为此使用了错误的 API。 您的端点转到 Adaptive Payments API,该 API 用于非常具体的业务案例并且实施起来非常复杂。

如果您想从使用 PayPal Express Checkout 或 PayPal Standard 的付款中进行简单的退款,您应该使用 RefundTransaction API 调用。 https://developer.paypal.com/docs/classic/express-checkout/ht_basicRefund-curl-etc/

你的 CURL 调用应该是这样的:

Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=merchant_user_name
&PWD=merchant_password
&SIGNATURE=merchant_signature
&METHOD=RefundTransaction
&VERSION=94
&TRANSACTIONID=transaction_ID    #ID of the transaction for which the refund is made 
&REFUNDTYPE=Full    #Specifies a full refund; a partial refund requires more input fields

【讨论】:

  • 非常感谢您的支持。现在我收到了这个错误:时间戳= 2016%2d03%2d01t17%3a15%3a35z&correlationId = 3c778604ba343&ack = fault&sworge = 94&build = 18316154&l_errorcode0 = 10002&l_shortmessage0 = security%20error&l_longmessage0 = security%20header%20not%20 not%20valid&l_severitycode0 =错误我打的电话是这样的: curl -v --data "USER=my username &PWD=mypassword &SIGNATURE=merchant_signature &METHOD=RefundTransaction &VERSION=94 &TRANSACTIONID="$tId" &REFUNDTYPE=Full" api-3t.sandbox.paypal.com/nvp
  • 当您的凭据错误时会显示安全标头错误。检查您使用的是正确的端点(沙盒或实时)并且您的 API 凭据正确。
猜你喜欢
  • 2021-09-26
  • 2014-02-13
  • 2013-04-07
  • 2011-12-18
  • 2015-04-22
  • 2016-04-17
  • 2019-07-30
  • 2019-07-18
  • 2011-07-02
相关资源
最近更新 更多