9

通过 XML API,如何将 Google Checkout 回调序列号与原始订单相关联?

在同一行 - XML API 文档的“选项 B - 提交服务器到服务器结帐 API 请求”部分中的序列号对应于什么(格式:) serial-number="981283ea-c324-44bb-a10c-fc3b2eba5707"?是否与回调 URL ( numeric-only) 发送的序列号有关?

4

1 回答 1

8

我过去这样做的方式是使用<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>

然后,在 Google 用序列号回拨后,我使用Notification History 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>

然后,我可以使用该密钥将订单与我之前存储在数据库中的详细信息进行匹配。

于 2011-02-12T17:03:37.000 回答