When querying Shopify transaction data (from the python api client) for transactions involving SagePay, we're receiving an error when the client attempts to parse the returned xml:
Error(Error('Unable to parse xml data: not well-formed (invalid token): line 24, column 7',),)
This appears to be being caused by the transaction/receipt element contents including an invalid xml tag name to indicate the 3D-secure status.
For instance:
<?xml version="1.0" encoding="UTF-8"?>
<transactions type="array">
<transaction>
<order-id type="integer">123456789</order-id>
<amount type="decimal">123.45</amount>
<status>success</status>
<kind>sale</kind>
<authorization>{-REDACTED-}</authorization>
<created-at type="datetime">2012-01-01T01:01:01+00:00</created-at>
<gateway>sage_pay_form</gateway>
<id type="integer">123456789</id>
<test type="boolean">false</test>
<receipt>
<VendorTxCode>123456789</VendorTxCode>
<VPSTxId>{-REDACTED-}</VPSTxId>
<Status>OK</Status>
<StatusDetail>0000 : The Authorisation was Successful.</StatusDetail>
<TxAuthNo>123456789</TxAuthNo>
<AVSCV2>SECURITY CODE MATCH ONLY</AVSCV2>
<AddressResult>NOTMATCHED</AddressResult>
<PostCodeResult>NOTMATCHED</PostCodeResult>
<CV2Result>MATCHED</CV2Result>
<GiftAid>0</GiftAid>
<3DSecureStatus>OK</3DSecureStatus>
<CAVV>-REDACTED-</CAVV>
<CardType>MC</CardType>
<Last4Digits>1234</Last4Digits>
<Amount>123.45</Amount>
</receipt>
</transaction>
</transactions>
As '3DSecureStatus' is not a valid xml element name, xml parsing fails.
We're currently not in a position to use the json api
as the python api client doesn't support it.