Search code examples
androidin-app-purchasegoogle-checkout

In-app developer payload in Google Checkout notifications


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?


Solution

  • 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