Question

Sandbox testing with Play Store subscription gives Cancellation with Billing error

  • 14 February 2022
  • 20 replies
  • 162 views

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. 


20 replies

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. 

Badge +1

@sundeep always.

Badge +1

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

Userlevel 1
Badge +4

I have this issue as well

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 +4

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

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).

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

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. 

Userlevel 1
Badge +4

 

$RCAnonymousID:bf5f68d6a7b04d5a99de2651b676c244

$RCAnonymousID:4e152e7d24e04e398b76bf2c5dbdeb42

I will look at the server-to-server notifications

Userlevel 1
Badge +4

I set up server-to-server notifications and now the behaviour is all over the place.

Nothing shows in the sandbox console when I make a purchase.

I get an email that the order is cancelled but other emails stating that the subscription is ongoing.

My app believes the subscription is cancelled but when I go to buy it again it says it is active. I if I tap Restore Purchases I get “Nothing to restore”

@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. 

 

Hi @sundeep, thanks for your reply, it does seem activating the server-to-server notifications fixed the issue for me for Google

Userlevel 1
Badge +4

I set up server-to-server notifications and now the behaviour is all over the place.

Nothing shows in the sandbox console when I make a purchase.

I get an email that the order is cancelled but other emails stating that the subscription is ongoing.

My app believes the subscription is cancelled but when I go to buy it again it says it is active. I if I tap Restore Purchases I get “Nothing to restore”

@sundeep I also received an email stating the subscription wasn’t acknowledged

Userlevel 1
Badge +4

@sundeep 

I have tried to de-activate server-to-server notifications but when I press ‘Disconnect From Google’. I get the following message.

Response not successful: Received status code 400.

Please advise ASAP how I get back to where I was before activating server-to-server notifications.

Userlevel 1
Badge +4

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 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 +4

@ryan

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

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?

 

Reply