How to distinguish test order and real order through billing service?
See original GitHub issueWe maintained a list of licensed Playstore email accounts on Google Play Console. These accounts are exempted from charges on credit card when they complete a payment flow in the app. They also see message This is a test order, you will not be charged
on the dialog. Upon successful billing, at onPurchasesUpdated
, we will get Purchase
where the orderId
field is empty. This is how we previously distinguished test order from real order.
Just recently, I found that for test order, orderId
is no longer empty but a seemingly legit values that starts with GPA.xxx
.
I look through the values provided by Billing service and it seems like there is no data which indicates if this order is test order.
I am currently using 'com.android.billingclient:billing:dp-1'
. It is still written in the javadoc that
/**
* Returns an unique order identifier for the transaction. This identifier corresponds to the
* Google payments order ID. If the order is a test purchase made through the In-app Billing
* Sandbox, orderId is blank.
*/
Would appreciate if anyone encountered the same issue and has more insights to this, and how do you distinguish real order and test order based on the receipt or from billing service. Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top GitHub Comments
@jessie345 You can check here GooglePlay API .The param you need to check is “purchaseType”
@yurain this is working as designed and we are not going to change behavior, sorry. But, we appreciate your feedback and we are studying another way to help developers to identify test purchases, probably using the server-side API.
Thanks