Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test subscription is revoked by GooglePlay

I'm working on a subscription renewal feature, in test mode, with testing payment methods. Problem is that we receive cancelation subscription webhook, GooglePlay makes subscription revoke. ​​ From params:

​"cancelReason": "1"

Status code from the docs,

Subscription was canceled by the system, for example, because of a billing problem.

Also from the docs

Revoking a subscription instantly removes access to the subscription and is usually done when you or Google suspects fraud.

Usually, it sends cancelation webhook immediately after renewal, even when it was successful, so there are cases when I got two e-mails, about renewal success and cancelation. In my case renewal called after 5 minutes (doc)

Have someone idea, what could be the reason? Is it some "Google anti-fraud system". Because for testing purpose we have short subscription period but the big price. But probably anti-fraud should not be executed when we do testing, with testing payment methods, when there is no real transaction.

like image 828
yozzz Avatar asked Jul 31 '19 16:07

yozzz


People also ask

How do I test app subscriptions on Android?

Open the Google Play app. Choose Account -> Subscriptions & Payments -> Subscriptions. Click your test subscription and change the payment method to “Test card, always declines.”


1 Answers

The problem was, that we didn't acknowledge new subscriptions.
From the docs:

If you use the Google Play Billing Library version 2.0 or newer, you must acknowledge all purchases within three days. Failure to properly acknowledge purchases results in those purchases being refunded.

Regarding subscriptions:

For subscriptions, you must acknowledge any purchase that contains a new purchase token. This means that all initial purchases, plan changes, and re-signups need to be acknowledged, but you do not need to acknowledge subsequent renewals.

Test acknowledging purchase with license testers:

For purchases made by license testers, the acknowledgment window is shorter. Instead of three days, purchases are refunded and revoked if they are not acknowledged within five minutes.

UPDATE changes in documentation

You should also verify that purchases are properly acknowledged as described in processing purchases. For purchases from license testers, a > purchase will be refunded after 3 minutes if your app does not acknowledge the purchase and you will receive an email about the cancellation. You can also check the Orders tab in the Google Play Console to see if an order was refunded after 3 minutes.

like image 58
yozzz Avatar answered Sep 20 '22 03:09

yozzz