2013-12-19 149 views
1

我嘗試運行ConvertCurrency自適應付款,但無法找到任何不使用SDK的示例代碼,所以我正在查看來自PayPal的PDF,但我仍然感到困惑。這些應該是什麼格式:PayPal自適應付款ConvertCurrency

baseAmountList AP:CurrencyList convertToCurrencyList AP:CurrencyCodeList requestEnvelope常見:RequestEnvelope

我不知道他們所說的AP:CurrencyList。這不起作用:

baseAmountList =」陣列( '量'=> 15 '代碼'=> '美元')

那麼應該怎樣做

先謝謝了。? 。

回答

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> 
+0

十分感謝安德魯! – user2226547

+0

如果幫你我會很感激的點。 –

+0

對不起安德魯我不知道你會做了一個評論因爲他們沒有通過電子郵件通知我。我如何給你點數,這還不清楚。 – user2226547

相關問題