I know that we can't use orderId as globally unique transaction ID in testing because orderId can be null.
In https://developer.android.com/google/play/billing/billing_testing.html
Note: Test purchases don't have an
orderIdfield. To track test purchases, you use thepurchaseTokenfield instead.
It is not clear to me whether or not purchaseToken is globally unique.
In https://developer.android.com/google/play/billing/billing_reference.html
A token that uniquely identifies a purchase for a given item and user pair.
It can be duplicate when it is a purchase for another item or user?
How can I identify all testing purchases?
Your app should contain the unique identifiers for each purchasable item (SKUs), the ability to present a catalog to the customer, and logic within the app to unlock the purchasable item upon successful transaction. App launches the in-app purchase flow.
Yes, it is globally unique.
https://developer.android.com/google/play/billing/security
purchaseToken is globally unique, so you can safely use this value as a primary key in your database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With