gpt4 book ai didi

xml - Shopify XML API 响应 - 无效的元素名称 : 3DSecureStatus

转载 作者:数据小太阳 更新时间:2023-10-29 02:45:53 29 4
gpt4 key购买 nike

当查询涉及 SagePay 的交易的 Shopify 交易数据(来自 python api 客户端)时,当客户端尝试解析返回的 xml 时,我们收到错误:

Error(Error('无法解析 xml 数据:格式不正确(无效标记):第 24 行,第 7 列',),)

这似乎是由交易/收据元素内容引起的,其中包括用于指示 3D 安全状态的无效 xml 标签名称。

例如:

<?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>

由于“3DSecureStatus”不是有效的 xml 元素名称,xml 解析失败。

我们目前无法使用 json api,因为 python api 客户端不支持它。

最佳答案

Shopify 将需要修复以不发送无效的 XML 元素名称。例如。元素名称可以使用下划线作为前缀。完成后我会在这里更新。

shopify python API中不支持JSON其实是pyactiveresource中不支持造成的。我发了JSON support patches上游到您可以使用的事件资源。由于缺乏上游事件,它们似乎已被忽略。

更新:Shopify 已修复,不会返回包含无效元素名称的 XML。相反,它会在元素名称中使用下划线作为无效起始字符的前缀。

关于xml - Shopify XML API 响应 - 无效的元素名称 : 3DSecureStatus,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13396578/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com