PayPal Refund API操作获取错误520002

时间:2016-02-24 14:37:30

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

我正在尝试用bash编写代码部分退款paypal交易。这是我关注https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/的指南,但我收到了520002错误消息。在之前的请求中,我已经看到需要指定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" ,但它仍然无效。 这就是我的要求:

cards[[0, 1, 2], [1, 2, 1]]

有人知道怎么解决吗?

1 个答案:

答案 0 :(得分:0)

我认为您正在使用错误的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
相关问题