PayPal自适应付款转换货币

时间:2013-12-19 21:07:26

标签: paypal

我尝试运行ConvertCurrency Adaptive Payments,但找不到任何不使用SDK的示例代码,因此我正在查看PayPal中的PDF,但我仍然感到困惑。这些格式应该是什么格式:

baseAmountList ap:CurrencyList convertToCurrencyList ap:CurrencyCodeList requestEnvelope common:RequestEnvelope

我不知道ap:CurrencyList是什么意思。这不起作用:

baseAmountList =“。array('amount'=> 15,'code'=>'USD')

那怎么办?

提前致谢。

1 个答案:

答案 0 :(得分:1)

这将是XML。这是一个示例请求和响应。

<?xml version="1.0" encoding="utf-8"?>
<ConvertCurrencyRequest xmlns="http://svcs.paypal.com/types/ap">
  <requestEnvelope xmlns="">
    <detailLevel>ReturnAll</detailLevel>
    <errorLanguage>en_US</errorLanguage>
  </requestEnvelope>
  <baseAmountList xmlns="">
    <currency xmlns=""><code xmlns="">USD</code>
      <amount xmlns="">100.00</amount>
    </currency>
  </baseAmountList>
  <convertToCurrencyList xmlns="">
    <currencyCode xmlns="">EUR</currencyCode>
    <currencyCode xmlns="">AUD</currencyCode>
    <currencyCode xmlns="">CAD</currencyCode>
  </convertToCurrencyList>
</ConvertCurrencyRequest>

<?xml version='1.0' encoding='UTF-8'?>
<ns2:ConvertCurrencyResponse xmlns:ns2="http://svcs.paypal.com/types/ap">
  <responseEnvelope>
    <timestamp>2013-12-19T23:22:07.832-08:00</timestamp>
    <ack>Success</ack>
    <correlationId>0d0f271253d3c</correlationId>
    <build>7935900</build>
  </responseEnvelope>
  <estimatedAmountTable>
    <currencyConversionList>
      <baseAmount><code>USD</code>
        <amount>100.00</amount>
      </baseAmount>
      <currencyList>
        <currency><code>EUR</code>
          <amount>73.39</amount>
        </currency>
        <currency><code>AUD</code>
          <amount>105.41</amount>
        </currency>
        <currency><code>CAD</code>
          <amount>100.76</amount>
        </currency>
      </currencyList>
    </currencyConversionList>
  </estimatedAmountTable>
</ns2:ConvertCurrencyResponse>