I'm working on migrating from https://github.com/serso/android-checkout lib to com.android.billingclient.api, the Checkout API allowed me to start the purchase flow by providing a develop payload as a parameter. like is shown below

     * @see #startPurchaseFlow(String, String, String, RequestListener)
    public void startPurchaseFlow(Sku sku, @Nullable String payload, RequestListener<Purchase> listener) {
        startPurchaseFlow(sku, payload, null, listener);

Later I would be able to retrieve the same developer payload while getting Purchase History.

Now working with com.android.billingclient.api I see that I can provide the a developer payload, looking at the code I see that in the BillingClientImpl of com.android.billingclient.api class the payload just provide as a null value

futureBuyIntentBundle =
              new Callable<Bundle>() {
                public Bundle call() throws Exception {
                  return mService.getBuyIntent(
                      /* apiVersion */ 3,
                      /* developerPayload */ null);

I'm wondering if it's a bug, or there is another way to store a developer payload within a purchase record.

1 Answers

DrPower On

You're right. Play Billing Library didn't support developer payload in prior 2.0 version. See https://issuetracker.google.com/issues/69079764.

Since 2.0, this is added back, but is moved to consume/acknowledge phase: https://developer.android.com/google/play/billing/billing_library_releases_notes#2_0_payload