2010-07-26 2 views
9

XML API를 통해 Google Checkout 콜백 일련 번호를 원래 주문과 어떻게 관련 지으시겠습니까?Google Checkout - XML ​​API가 원래 주문과 연관 됨

동일한 줄에 - XML API doc의 "옵션 B - 서버 간 체크 아웃 API 요청 제출"섹션의 일련 번호는 (형식 : serial-number="981283ea-c324-44bb-a10c-fc3b2eba5707")에 해당합니까? 콜백 URL (numeric-only)이 보낸 일련 번호와 관련이 있습니까?

답변

8

의 I는 원래 카트에 <merchanrt-private-data> 태그를 사용하고 과거에 이런 짓을 한 방법, 그래서 뭔가 같은 : Google은 다시 일련 번호를 호출 한 후

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

다음, 내가 사용하는

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

그때 내가 이전에 데이터베이스에 저장했던 세부 사항까지 주문을 일치하도록 비밀을 사용할 수 있습니다 : Notification History API는 내 개인 데이터를 같은 것을 포함하는 주문 세부 정보를 검색 할 수 있습니다.

+0

이 XML을 처리하는 좋은 방법에 대해 알고 계십니까? API를 사용하려고 할 때 getMerchantPrivateData는 AnyMultiple을 반환하고 데이터를 가져올 수 없습니다. – Lumpy

+0

@Lumpy XML과 객체를 반환하는 XML API와 관련된 일종의 래퍼를 사용하는 것처럼 들리지만 새로운 질문을하고 라이브러리를 지정하는 것이 더 낫습니다 –

+1

@RowlandShaw This saved 내 인생. 나는 왜 구글이 문서에서 이것을 언급하지 않는지 이해하지 못한다. –

관련 문제