序言:这个问题已经过时了。不再有 Checkout API。
当您进行应用内购买时,有一个名为“开发人员有效负载”的字段。这个想法是,你将它与订单相关联,谷歌就会传递它,并随时将其返还给你。
当您通过通知 API 从 Google Checkout 检索订单时,开发人员负载是否存在?我搜索了 XML,发现了两个有希望的元素:
还有
,但其结构是相当清楚的。
两者似乎都是 Base64 编码的二进制文件。解码提供了没有可辨别结构的二进制块 - 可能是 Base64 下面的另一层编码。有谁知道这些是什么意思,以及开发人员有效负载是否在某处?
PREAMBLE: this question is wildly obsolete. There's no more Checkout API.
When you do in-app purchases, there's a field called "Developer Payload". The idea is that you associate it with an order and Google will pass it around, giving it back to you whenever.
When you retrieve the order from Google Checkout via the Notification API, is Developer Payload there? I've searched the XML and I've found two promising elements:
<merchant-private-item-data>
under <item>
<merchant-private-data>
under <shopping-cart>
There's also <agent-private-data>
, but the structure of that is fairly clear.
Both seem to be Base64-encoded binary. Decoding provides a binary chunk of no discernible structure - could be another layer of encoding below that Base64. Does anyone have any idea what do those mean, and if developer payload is in there somewhere?
发布评论
评论(1)
您将返回developerPayload信息,作为随PURCHASE_STATE_CHANGED意图返回的JSON字段之一:
http://developer.android.com/guide/market/billing/billing_reference.html#billing-interface
另请参阅这个答案了解更多细节和讨论。
您所指的通知 API 字段是经典 Checkout API 的一部分,developerPayload 不会在那里。使用 Checkout API 发布 XML 购物车时,它们非常有用:
http: //code.google.com/apis/checkout/developer/Google_Checkout_XML_API.html#checkout_api
You will get back the developerPayload information as one of the JSON fields that are returned with a PURCHASE_STATE_CHANGED intent:
http://developer.android.com/guide/market/billing/billing_reference.html#billing-interface
Also see this answer for more details and discussions.
The Notification API fields you are referring to are part of the classic Checkout API and the developerPayload will not be there. They are useful when posting an XML shopping cart using the Checkout API:
http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API.html#checkout_api