Question

Sandbox testing with Play Store subscription gives Cancellation with Billing error

  • 14 February 2022
  • 30 replies
  • 1214 views

Userlevel 1
Badge +1

I am making a test purchase for a monthly subscription. It happens correctly the first time and for the correct user. I am using the always accept visa card from google testers. There is exactly one renewal happening which is fine and the second time I get CANCELLATION with BILLING_ERROR on the sandbox. 


30 replies

Userlevel 1
Badge +5

Hi @sundeep 

Thanks for the reply.

I have checked the orders in the Play Console and they all expire after 6 renewals. No billing errors.

So what is happening that the revenueCat Console reports a billing error.  None of the test subscriptions go their full term (6 renewals)

regards

Peter

Userlevel 5
Badge +9

@Peter Rule it sounds like the Play Store credentials you’ve entered in the RevenueCat dashboard are invalid. Without valid Play Store credentials purchases cannot be tracked or acknowledged by RevenueCat, and could cause a host of other issues.

You can confirm this by making a purchase with debug logs enabled and inspecting the log output for “Invalid credentials”. 

Userlevel 1
Badge +5

hi @sundeep I successfully de-activated server-to-server notifications but I still get the error email 

“this test purchase was cancelled because it was not acknowledged”. This only started occurring when I activated server-to-server notifications per your suggestion.

Please advise how I can get back to where I was.

Userlevel 1
Badge +5

@ryan

Thanks that was it somehow the Service Account credentials JSON became unpopulated after I tried server to server notifications.

Badge +1

I have found this question on StackOverflow, where people suggest this is the normal and expected behavior of Google Play sibscriptions test mode, although I am not quite sure about it.

https://stackoverflow.com/questions/57869868/google-play-billing-testing-mode-why-my-purchase-is-automatically-canceled

Since people there have upvoted the answers, it may be they are right. And if they are right, then this may not be a RevenueCat issue, but Google Play’s normal behavior.

 

Hi @UlyssesAlves I am facing the same problem of cancellations with each subscription. How did you fix it?

Userlevel 1
Badge +1

@sundeep always.

Userlevel 1
Badge +6

@Sakhile Mamba I didn’t fix it. But now that I think about it, I have been getting cancellations in production, but I don’t know if it was my app users who unsubscribed or if it was this error taking place. Can’t say that for sure, unfortunately.

Userlevel 1
Badge +1

@ryan @sundeep using the RC guide to connect pub/sub isn’t working for me. I have a Firebase google play console credentials JSON but pub/sub requires a GCP service credentials account. Google says it is possible you have a different GCP and Firebase credentials but in RC dashboard in the app section connect to google returns a 400 error.

 

@Peter Rule I am afraid to publish into production. Can you confirm you only had the bug in the sandbox?

 

Badge +1

@UlyssesAlves I realized that I hadn’t input my app’s package ID into RevenueCat, the package ID in “build.gradle” for android. After I fixed this, I haven’t experienced those cancellations since.

Maybe this will be helpful to you.

Userlevel 1
Badge +6

@UlyssesAlves I realized that I hadn’t input my app’s package ID into RevenueCat, the package ID in “build.gradle” for android. After I fixed this, I haven’t experienced those cancellations since.

Maybe this will be helpful to you.

This is already set up in my project on Revenue Cat. Without it it wouldn’t surely work. But it’s good that you fixed it in your configuration. Mine may be something different.

Userlevel 1
Badge +6

I am also experiencing unexpected cancellations of my test subscriptions in sandbox on Google Play. I would expect the test subscriptions to auto-renew every 5 minutes, rather than being cancelled after 5 minutes, because I have setup the subscription to auto-renew, not to auto cancel.

@Juliana Pagnoncelli Ferreira and @Peter Rule , have you published your apps in production? Does it work ok?

It would be a really serious issue both to me and to my customers to have my purchases gone cancelled in production.

Userlevel 2
Badge +6

Hi @UlyssesAlves,

 

Unfortunately, I cannot help debugging the specifics because I don’t have all the details, but my bet is that this is happening due to not acknowledging in time (therefore triggering a cancellation). This would not happen in production, since we do acknowledge Play Store purchases server side (but not in the first 5 minutes). SDK should also acknowledge though, unless you are in observer mode. Could that be the case?

Userlevel 1
Badge +6

@Miguel Carranza I couldn’t find a method in the SDK to acknowledge the purchases. My assumption is that it is mayble automatically acknowledged internally by the SDK, not with a public API/method I can call from my app. If that’s not the case, how should I acknowlege the purchases?

Userlevel 2
Badge +6

The SDK should do it automatically unless it’s set up in observer mode. If that’s not the case, I’d recommend you to reach to RevenueCat support with more information for further investigation.

Userlevel 1
Badge +6

No. I am not under observer mode, because I don’t pass any value to parameter observerMode of SDK setup method, which passes false to this argument by default.

 

Userlevel 1
Badge +6

I have found this question on StackOverflow, where people suggest this is the normal and expected behavior of Google Play sibscriptions test mode, although I am not quite sure about it.

https://stackoverflow.com/questions/57869868/google-play-billing-testing-mode-why-my-purchase-is-automatically-canceled

Since people there have upvoted the answers, it may be they are right. And if they are right, then this may not be a RevenueCat issue, but Google Play’s normal behavior.

Userlevel 1
Badge +1

@sundeep what can be done about this? it’s a total blocker for me publishing my app

Userlevel 1
Badge +5

I have this issue as well

Userlevel 3
Badge +8

Hi @aris, is this happening consistently when you test (cancelling after the first renewal), or only sometimes? I know that in sandbox it’s common for billing errors to be thrown occasionally just so you can test that scenario. 

Userlevel 3
Badge +8

Hi @aris, if it’s happening consistently after exactly 1 renewal, then honestly I’m not too sure - have you tried this flow with different sandbox accounts?

RevenueCat just reports what the store says about the user’s transactions, so if Google says the subscription was cancelled, then that’s what we’ll indicate to you. Can you check the order ID for this transaction in Google Play Console > Order Management - does it list the subscription as cancelled? You can use the transaction ID you’re seeing in the RevenueCat webhooks to search for the order in the console.

Userlevel 1
Badge +1

Hi @sundeep I have exactly the same problem with @Peter Rule and it’s not a coincidence. For the same transaction id google play console correctly renews 6 times and revenuecat reports billing error after the 2nd renewal. I think it’s time to give the bug to the developers. 

 

Userlevel 3
Badge +8

Hi @aris - I’ve turned this post into a ticket in our system so I can ask some follow-up questions and get some examples (you should see a message in your email inbox).

Badge +2

Hi @sundeep , I am having the same issue while testing our App, for us it seems like it is always skipping one renew cycle, so when the user subscribes it works fine, then after 5 minutes I get renewal confirmation on my email and then revenuecat says there was a failure (either cancellation or billing error which is not correct), then in the 2nd renewal, it starts working again and I get the correct subscription.. been testing this the whole day seems to be affecting only Android at the moment

Badge +2

We wish to publish the application next saturday, can we be sure that this will not be a problem in production?

Userlevel 3
Badge +8

@aris @Peter Rule I spoke with an engineer and they suggested turning on server-to-server notifications to see if that affects the result (there are some differences in how we refresh receipts in sandbox vs. production and it’s possible that’s playing a role). I looked at your app configs and noticed you don’t have server-to-server notifications set up for Google, can you go through this guide to set those up and then try this again? https://docs.revenuecat.com/docs/google-server-notifications

Also, would you be able to share some recent sandbox App User IDs with this issue so I can take a closer look?

@Juliana Pagnoncelli Ferreira we’ve only heard about this occurring in sandbox, so I don’t think you need to worry about this in production. 

Reply