2017-03-10 42 views
0

我試圖用SagePay 3.00協議的以下XML創建BasketXML條目。但我不斷收到「3021:籃子格式無效」錯誤。Sagepay協議3.00 - BasketXML格式 - 折扣

這裏是我的XML:

<basket> 
    <item> 
     <description>Product desc here</description> 
     <productSku>AWAL02</productSku> 
     <productCode>AWAL02</productCode> 
     <quantity>2</quantity> 
     <unitNetAmount>22.00</unitNetAmount> 
     <unitTaxAmount>0.00</unitTaxAmount> 
     <unitGrossAmount>22.00</unitGrossAmount> 
     <totalGrossAmount>44.00</totalGrossAmount> 
    </item> 

    <deliveryNetAmount>10.00</deliveryNetAmount> 
    <deliveryTaxAmount>0.00</deliveryTaxAmount> 
    <deliveryGrossAmount>10.00</deliveryGrossAmount> 

    <discounts> 
     <discount> 
      <fixed>5.40</fixed> 
      <description>Voucher: PB test</description> 
     </discount> 
    </discounts> 
</basket> 

任何一個有任何想法,爲什麼這是無效的?在POST

48.60

爲transactionRegistration:我還提供了總交易量。

任何想法爲什麼它是一個無效的籃子?

非常感謝,

彼得

+0

你如何將Basket XML發送到服務器? – DavidG

回答

0

解決:

原來,實際上是被髮送包含一些HTML字符。即使他們被正確編碼,如:

This is &lt;b&gt;bold&lt;/b&gt; 

反正 - 提交籃之前剝離標籤似乎已經完成了帽子戲法。

文檔確實告訴我,有些字符不被SagePay接受(即使有效的xml)。我的錯。

(並道歉示例代碼沒有正確地重現該問題)。