如何使用Classic API进行paypal部分退款?

时间:2013-12-24 10:56:54

标签: api paypal

我使用自适应付款进行付款。 如何部分退款?似乎在这里回答https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-payments/Refund_API_Operation/。但是我要做的API调用之王是什么?

1 个答案:

答案 0 :(得分:0)

Adaptive Payments API使用XML。以下是退款请求和回复的示例,尽管我的回复与平时略有不同,因为我已经处理了此特定退款。

<?xml version="1.0" encoding="utf-8"?>
<RefundRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <currencyCode xmlns="">USD</currencyCode>
  <receiverList xmlns="">
    <receiver xmlns="">
      <amount xmlns="">100.00</amount>
      <email xmlns="">agb_1296755685_biz@angelleye.com</email>
      <paymentType xmlns="">GOODS</paymentType>
    </receiver>
  </receiverList>
  <transactionId xmlns="">9JK32129X69021028</transactionId>
</RefundRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns2:RefundResponse xmlns:ns2="http://svcs.paypal.com/types/ap">
  <responseEnvelope>
    <timestamp>2013-12-25T22:54:01.871-08:00</timestamp>
    <ack>Success</ack>
    <correlationId>5d44463c7350c</correlationId>
    <build>7935900</build>
  </responseEnvelope>
  <currencyCode>USD</currencyCode>
  <refundInfoList>
    <refundInfo>
      <receiver>
        <amount>100.00</amount>
        <email>agb_1296755685_biz@angelleye.com</email>
      </receiver>
      <refundStatus>ALREADY_REVERSED_OR_REFUNDED</refundStatus>
      <refundHasBecomeFull>true</refundHasBecomeFull>
    </refundInfo>
  </refundInfoList>
</ns2:RefundResponse>