如何退还paypal自适应付款的部分金额

时间:2015-08-06 10:49:44

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

我正在开发paypal自适应支付&我需要使用API​​退款,我可以全额退款,但我还需要退还部分金额
我正在使用的参考网址:https://developer.paypal.com/docs/classic/api/adaptive-payments/Refund_API_Operation/ 例如 - 付款时的总金额为100&我只需要退款50.00

我尝试使用代码/ api参数

-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 
&transactionId=AP-95V43510SV018561T0"

&安培;尝试这些输入设置退款金额

&amount = 50.0

&安培;

&amount = XS:50.0

但这些工作都不能全额退还

1 个答案:

答案 0 :(得分:4)

对您的请求有效负载进行一点修正," AP-95V43510SV018561T0"是一个付费密钥值(从Pay api响应中获得),名称对应该是 payKey = AP-95V43510SV018561T0

具有最小参数的部分退款有效负载将是这样的,例如,如果您刚刚进行了100美元的交易并且即将进行50美元的退款:

requestEnvelope.errorLanguage = en_US
detailLevel = ReturnAll 
payKey = AP-95V43510SV018561T0
receiverList.receiver(0).email = receiver@paypal.com
receiverList.receiver(0).amount = 50.00
currencyCode = USD

API响应:

responseEnvelope.timestamp=2015-08-06T07:39:08.861-07:00
responseEnvelope.ack=Success
responseEnvelope.correlationId=2e7007b68f85b
responseEnvelope.build=17603431
currencyCode=USD
refundInfoList.refundInfo(0).receiver.amount=50.00
refundInfoList.refundInfo(0).receiver.email=receiver@paypal.com
refundInfoList.refundInfo(0).refundStatus=REFUNDED
refundInfoList.refundInfo(0).refundNetAmount=48.05
refundInfoList.refundInfo(0).refundFeeAmount=1.95
refundInfoList.refundInfo(0).refundGrossAmount=50.00
refundInfoList.refundInfo(0).totalOfAllRefunds=50.00
refundInfoList.refundInfo(0).refundHasBecomeFull=false
refundInfoList.refundInfo(0).encryptedRefundTransactionId=96U15993F0258151X
refundInfoList.refundInfo(0).refundTransactionStatus=COMPLETED