【发布时间】:2011-05-20 09:45:36
【问题描述】:
Google checkout 在动态商家发货回调计算方面存在问题。
当客户点击使用谷歌按钮结帐时,我输入了称为“默认送货”的送货方式,运费为 100 美元。
此默认值仅在客户选择送货地址和谷歌回调到商家网站以获取送货方式失败时才会显示给客户。
当客户登录谷歌账户并输入送货地址(国家/城市/州/邮政编码...)时,谷歌会立即回调商家脚本以获取最新的可用送货方式。
我可以成功地让谷歌回电给我,但我的谷歌送货方式不被接受。
例子,
当客户选择运送到美国北卡罗来纳州时,则:
- 我会将 FedEx Economy 作为送货方式退回(我的系统将根据给定地址检索可用的送货方式)
- 我根本不需要显示默认运费
但谷歌在下面说错误:
商家计算:我们在您的商家计算结果中查找数据,但未能找到:结果:地址 ID:209802946439880shipping-name:失败时默认发货
从谷歌即时回调收到的 XML:
<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-callback xmlns="http://checkout.google.com/schema/2" serial-number="abd99db3-d3e3-485b-ba9c-75863d02ed65">
<shopping-cart>
<merchant-private-data>
<session-id>f199c97f7fa9b19ade6fa57a17ce79d61508aef4</session-id>
</merchant-private-data>
<items>
<item>
<item-weight value="0.0" unit="LB" />
<tax-table-selector>food</tax-table-selector>
<item-name>Test prod 3</item-name>
<item-description></item-description>
<unit-price currency="USD">1.0</unit-price>
<quantity>1</quantity>
<merchant-item-id>test11</merchant-item-id>
</item>
</items>
<cart-expiration>
<good-until-date>2011-05-20T23:59:59.000Z</good-until-date>
</cart-expiration>
</shopping-cart>
<buyer-id>119687448728341</buyer-id>
<calculate>
<addresses>
<anonymous-address id="209802946439880">
<country-code>US</country-code>
<city>Charlotte</city>
<region>NC</region>
<postal-code>28227</postal-code>
</anonymous-address>
</addresses>
<shipping>
<method name="default shipping" />
</shipping>
<tax>false</tax>
<merchant-code-strings />
</calculate>
<buyer-language>English</buyer-language>
</merchant-calculation-callback>
在商家脚本自定义运费计算完成后发布到谷歌的 XML:
<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/2">
<results>
<result shipping-name="Fedex Economy" address-id="209802946439880">
<shipping-rate currency="USD">15.20</shipping-rate>
<shippable>true</shippable>
</result>
</results>
</merchant-calculation-results>
所以我怀疑当我发回 google 时,google 必须要求我返回相同的默认送货名称。
我试过了,如果通过修改运费返回相同的默认运费名称,它就可以了!
但是当我返回相同的默认运输名称,同时将联邦快递经济的附加运输方式返回给谷歌时,谷歌会回复错误说无效的额外数据:
商家计算:您在商家计算结果中向我们发送了无效的额外数据:[address-id: 209802946439880/shipping-name: Fedex Economy]
<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/2">
<results>
<result shipping-name="default shipping" address-id="209802946439880">
<shipping-rate currency="USD">8</shipping-rate>
<shippable>true</shippable>
</result>
<result shipping-name="Fedex Economy" address-id="209802946439880">
<shipping-rate currency="USD">15.20</shipping-rate>
<shippable>true</shippable>
</result>
</results>
</merchant-calculation-results>
怎么会!有这样的规矩是不是不切实际……
当 google 将送货城市/州/邮政编码/国家/地区传回给我时,我的系统将仅计算并返回可用的送货方式
这意味着在谷歌让我知道地址之前,我什至不知道特定客户有多少种送货方式。
【问题讨论】:
标签: google-checkout