Skip to main content
Solved

[Flutter & Android] after refund, still get active entitlement

  • 12 November 2021
  • 9 replies
  • 616 views

Forum|alt.badge.img+2

Hi,

I am developing an app for Android using Flutter and I am trying your awesome service!!
All is working fine by now, but the refund operation. I explaining what I did till now:
I have purchased successfully a non-cosumable (life time) with my testing account. This is working fine also when restarting the app without internet active also after hours, meaning the cache does the job.

Then I refunded the account in Google Play console and waited till it was successfuly refunded.

Starting the app the entitlement is still active. At start I check this using:

PurchaserInfo purchaserInfo = await Purchases.getPurchaserInfo();
purchaserInfo.entitlements.all['myLifeTimeEntitlement']?.isActive  <== this is true

Basically I have the same issue described in this post:
https://community.revenuecat.com/topic/show?tid=326&fid=7

I read somewhere that the SDK cache is refreshed about every 5 minutes. Thinking about this, I found:

await Purchases.invalidatePurchaserInfoCache();

which is not recommended. Anyway seems not to work and I didn't find anything similar to try.
So I tried to uninstall and reinstall the app. And this worked! The entitlement.isActive was set to false.

I think I missed something, any help is greatly appreciated!
Thanks for your time

Best answer by ryan

Hey @Marco B.!

I’ve found that doing Purchases.reset() and call restoreTransactions() the isActive value is corrected after the user made the refund. But I don’t know if this is the correct way since reset() is deprecated.

Calling .reset() will change the underlying App User ID, essentially creating a new anonymous user. Then .restoreTransactions() will re-sync the underlying purchase tokens on the device with their account.

It’s not recommended to call .reset() or .restoreTransactions() programatically. Usually these should be triggered through some customer interaction when they logout, or tap a “Restore Purchases” button.

Detecting non-subscription refunds initiated through Google Play is currently a gap in the system without a clean workaround. I know some developers have built some on-device systems to check for this, but the server-side subscription status from RevenueCat unfortunately can’t react to refunds through Google Play. For subscriptions, this isn’t as big of an issue since the entitlement is revoked at the end of the subscription period. 

 

 

 

View original
Did this post help you find an answer to your question?

9 replies

Forum|alt.badge.img+2
  • Author
  • New Member
  • 2 replies
  • November 13, 2021

Some more info:

the log after calling invalidatePurchaserInfoCache() is:

D/[Purchases] - DEBUG: ℹ️ Invalidating PurchaserInfo cache.
D/[Purchases] - DEBUG: ℹ️ No cached PurchaserInfo, fetching from network.
D/[Purchases] - DEBUG: 😻 PurchaserInfo updated from network.
D/[Purchases] - DEBUG: ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3A03a90e4607c44dd3b03b1719a15d47a3
D/[Purchases] - DEBUG: ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3A03a90e4607c44dd3b03b1719a15d47a3 304

 

I also tried to call Purchases.reset() and this is working. The cache is cleared and the purchaser info are fetched correctly hence the entitlement after the refund has isActive=false as expected.

But the reset() method is deprecated in favor of logout(). The latter gives this error:

E/[Purchases] - ERROR: 😿‼️ Called logOut but the current user is anonymous


jazmine
Forum|alt.badge.img+7
  • Dedicated Contributor
  • 122 replies
  • November 22, 2021

Hey @Marco B. :wave:

When refunding a subscription with Android we don’t recommend refunding from the Google Play Console since RevenueCat cannot track refunds initiated through the Google Play console. You can either refund from the dashboard or via our REST API endpoint. Here are more information in our docs here: https://docs.revenuecat.com/docs/managing-subscriptions#play-store.    


Forum|alt.badge.img+2
  • Author
  • New Member
  • 2 replies
  • November 22, 2021

Thank you @jazmine,

I’ll take care of your suggestion. I never made a refund myself, but happens that the user made it following the “refund” link given in the email Google send to purchasers.

I’ve found that doing Purchases.reset() and call restoreTransactions() the isActive value is corrected after the user made the refund. But I don’t know if this is the correct way since reset() is deprecated.

Thanks for any clarification!


ryan
RevenueCat Staff
Forum|alt.badge.img+9
  • RevenueCat Staff
  • 391 replies
  • Answer
  • November 22, 2021

Hey @Marco B.!

I’ve found that doing Purchases.reset() and call restoreTransactions() the isActive value is corrected after the user made the refund. But I don’t know if this is the correct way since reset() is deprecated.

Calling .reset() will change the underlying App User ID, essentially creating a new anonymous user. Then .restoreTransactions() will re-sync the underlying purchase tokens on the device with their account.

It’s not recommended to call .reset() or .restoreTransactions() programatically. Usually these should be triggered through some customer interaction when they logout, or tap a “Restore Purchases” button.

Detecting non-subscription refunds initiated through Google Play is currently a gap in the system without a clean workaround. I know some developers have built some on-device systems to check for this, but the server-side subscription status from RevenueCat unfortunately can’t react to refunds through Google Play. For subscriptions, this isn’t as big of an issue since the entitlement is revoked at the end of the subscription period. 

 

 

 


Forum|alt.badge.img+6
  • Active Member
  • 10 replies
  • December 2, 2021
ryan wrote:

Hey @Marco B.!

I’ve found that doing Purchases.reset() and call restoreTransactions() the isActive value is corrected after the user made the refund. But I don’t know if this is the correct way since reset() is deprecated.

Calling .reset() will change the underlying App User ID, essentially creating a new anonymous user. Then .restoreTransactions() will re-sync the underlying purchase tokens on the device with their account.

It’s not recommended to call .reset() or .restoreTransactions() programatically. Usually these should be triggered through some customer interaction when they logout, or tap a “Restore Purchases” button.

Detecting non-subscription refunds initiated through Google Play is currently a gap in the system without a clean workaround. I know some developers have built some on-device systems to check for this, but the server-side subscription status from RevenueCat unfortunately can’t react to refunds through Google Play. For subscriptions, this isn’t as big of an issue since the entitlement is revoked at the end of the subscription period. 

 

 

 

Hey! What is the on-device systems to check for this ? I need it for Google Play Pass program. If in app purchase is refunded by user it shouldn’t be treated as active. 


Forum|alt.badge.img+6
  • Active Member
  • 10 replies
  • September 3, 2024

Hi,

what’t the correct solution for the problem?

I used the hack with the .reset and .restoreTransactions, but it creates different problems like user duplications. 

 

I want to have Google Play Pass with reveneucat, but it looks that there is no solution to do that. 


Forum|alt.badge.img+6
  • Active Member
  • 10 replies
  • November 19, 2024
Roman wrote:

Hi,

what’t the correct solution for the problem?

I used the hack with the .reset and .restoreTransactions, but it creates different problems like user duplications. 

 

I want to have Google Play Pass with reveneucat, but it looks that there is no solution to do that. 

 

I receive an email from Google Play team:

 

- If the app relies on a purchase management solution that takes 24 hours to sync entitlements, the app either needs to use a different product management solution. It's not acceptable for Google Play Pass to have a 24 delay for entitlement revocation.

 

 

So the only option is to change the purchase management solution to include Google Play Pass?


jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 139 replies
  • November 20, 2024

@Roman Can you clarify the issue you’re experiencing? You mentioned Google Play Pass - are you selling subscriptions via Google Play Pass, or are you experiencing issues regarding non-consumables, like the original customer that created this post? Is it refunding that’s causing issues? Any additional information you can provide would be helpful. Thanks.


Forum|alt.badge.img+6
  • Active Member
  • 10 replies
  • November 20, 2024

@jeffrey_bunn unfortunately, there is no possibility to sell subscription via Google Play Pass. Only way is to add non-consumable product.

 

The current problem is mentioned by  ​@ryan :

 

Detecting non-subscription refunds initiated through Google Play is currently a gap in the system without a clean workaround. I know some developers have built some on-device systems to check for this, but the server-side subscription status from RevenueCat unfortunately can’t react to refunds through Google Play. For subscriptions, this isn’t as big of an issue since the entitlement is revoked at the end of the subscription period. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings