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 に答える