通过XML API,如何将Google Checkout回调序列号与原始订单相关联?
在同一行 - XML API文档的"选项B - 提交服务器到服务器检出API请求"部分中的序列号对应于什么(格式:)serial-number="981283ea-c324-44bb-a10c-fc3b2eba5707"?它与回调URL(numeric-only)发送的序列有关吗?
我过去这样做的方法是使用<merchanrt-private-data>原始购物车中的标签,如下所示:
<checkout-shopping-cart xmlns='http://checkout.google.com/schema/2'>
<shopping-cart>
<merchant-private-data>
<merchant-note>[some secret about the cart on my system]</merchant-note>
</merchant-private-data>
<items>
...
</items>
</shopping-cart>
</checkout-shopping-cart>
Run Code Online (Sandbox Code Playgroud)
然后,在Google使用序列号回拨之后,我使用通知历史记录API来检索订单详细信息,然后包含我的私人数据,例如:
<new-order-notification xmlns="http://checkout.google.com/schema/2" serial-number="[serial number from google]">
<buyer-billing-address>
...
</buyer-billing-address>
<timestamp>...</timestamp>
<google-order-number>...</google-order-number>
<order-summary>
<total-chargeback-amount currency="GBP">...</total-chargeback-amount>
<google-order-number>...</google-order-number>
<total-charge-amount currency="GBP">...</total-charge-amount>
<total-refund-amount currency="GBP">...</total-refund-amount>
<purchase-date>...</purchase-date>
<archived>false</archived>
<shopping-cart>
<merchant-private-data>
<merchant-note>[the secret about the cart from my system]</merchant-note>
</merchant-private-data>
<items>
</items>
</shopping-cart>
<order-adjustment>
...
</order-adjustment>
<promotions />
<buyer-id>...</buyer-id>
<buyer-marketing-preferences>
<email-allowed>false</email-allowed>
</buyer-marketing-preferences>
<buyer-shipping-address>
...
</buyer-shipping-address>
<order-total currency="GBP">...</order-total>
<fulfillment-order-state>NEW</fulfillment-order-state>
<financial-order-state>REVIEWING</financial-order-state>
</order-summary>
<shopping-cart>
<merchant-private-data>
<merchant-note>[the secret about the cart from my system]</merchant-note>
</merchant-private-data>
<items>
</items>
</shopping-cart>
<order-adjustment>
...
</order-adjustment>
<promotions />
<buyer-id>...</buyer-id>
<buyer-marketing-preferences>
<email-allowed>false</email-allowed>
</buyer-marketing-preferences>
<buyer-shipping-address>
...
</buyer-shipping-address>
<order-total currency="GBP">...</order-total>
<fulfillment-order-state>NEW</fulfillment-order-state>
<financial-order-state>REVIEWING</financial-order-state>
</new-order-notification>
Run Code Online (Sandbox Code Playgroud)
然后,我可以使用该秘密来匹配订单,直到我之前存储在数据库中的详细信息.
| 归档时间: |
|
| 查看次数: |
1971 次 |
| 最近记录: |