Andrey P
Andrey P

Reputation: 11

Play Billing Library is missing developerPayload

I'm planning to migrate to Play Billing Library, but there is absent developerPayload. It was very useful for validating on server side with additional information. Are there any other ways to add developerPayload to purchase?

UPDATE: I found another way to validate: https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setObfuscatedAccountId(java.lang.String)

Upvotes: 1

Views: 1715

Answers (2)

Dake
Dake

Reputation: 21

In addition to what Chris said you can use my own fork of the Play Billing Library with support of the developerPayload https://github.com/DimaDake/billing

BillingFlowParams flowParams = BillingFlowParams.newBuilder()
                        .setSku("inapp_1")
                        .setType(SkuType.INAPP)
                        .setDeveloperPayload("your_custom_developer_payload")
                        .build();
int responseCode = billingClient.launchBillingFlow(MainActivity.this, flowParams);

Upvotes: 0

Chris Cartland
Chris Cartland

Reputation: 3278

The developerPayload is not included in the Google Play Billing Library.

https://issuetracker.google.com/issues/63381481

https://github.com/googlesamples/android-play-billing/issues/78

The Google Play server API will verify that the purchase was processed by Google.

If your server needs to verify the authenticity of the client app (when you send the purchaseToken to the server), you can send extra information from the client app.

Upvotes: 1

Related Questions