RevenueCat / purchases-flutter

Flutter plugin for in-app purchases and subscriptions. Supports iOS, macOS and Android.
https://www.revenuecat.com/
MIT License
607 stars 168 forks source link

Refunding and revoking an inapp purchase doesn't disable his entitlement #323

Closed rocboronat closed 2 years ago

rocboronat commented 2 years ago

Describe the bug Refunding and revoking an inapp purchase doesn't disable an entitlement.

  1. Environment
    1. Output of flutter doctor: Below.
    2. How widespread is the issue. Percentage of devices affected: 100%. Tried with two different test accounts.
  2. Debug logs that reproduce the issue: Doesn't apply I think.
  3. Steps to reproduce, with a description of expected vs. actual behavior: Below.
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Steps to reproduce

  1. Launch the app in a new test Google account, with no purchases anywhere
  2. Buy an inapp purchase that nobody will consume, so it should be lifetime
  3. Check that the app has the related entitlement
  4. Go to the developer Google Play Console, refund and revoke the inapp purchase
  5. Open the app and check that the user still has the entitlement

Additional context As we are still checking the platform, we only tested with test purchases. The same happened to other test user purchase, that I refunded but not revoked. As I didn't revoke it, I guessed that not revoking the entitlement was regular behavior.

Flutter doctor 👇

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.1, on Microsoft Windows [Version 10.0.19042.1526], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[!] Visual Studio - develop for Windows (Visual Studio Build Tools 2017 15.9.33)
    X Visual Studio 2019 or later is required.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2020.3)
[√] IntelliJ IDEA Community Edition (version 2020.3)
[√] Connected device (4 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.
aboedo commented 2 years ago

hi @rocboronat! Thanks for opening!

Yeah... Google's refunds are tricky. Here's the thing: it's impossible to detect a refund that's been issued from Google programmatically 😢

So if a customer gets refunded directly from Google Play Console, then the entitlement won't be revoked.

What you can do, though, is to issue the refund either through the RevenueCat Dashboard or through our REST API. That will correctly revoke the entitlement, and chart data will be consistent too.

More information about this particular behavior is available here

rocboronat commented 2 years ago

Cool! Thank you so much @aboedo, I didn't know that behavior difference. Thanks thanks thanks.

Right now the issue is that the RevenueCat page says The order cannot be refunded because the refund deadline has passed. Is there any way to remove. anentitlement? As I can't refund the purchase, I can't test buying other items.

aboedo commented 2 years ago

oooff that's a bummer.

🤔

So, if the deadline has passed, there are a few ways this can go:

for a subscription:

If this is too long and annoying or you're having issues, you can always have another test account. I realize that that's annoying, though.

Let me know which one is your case so we can dig deeper and figure this out!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Please reach out if you have additional information to help us investigate further!

rocboronat commented 2 years ago

Hey Bot! Now you behaved, haha!

@aboedo thank you so much for your comment! What I did was just create some Gmail accounts to test while I developed. But honestly, I think something happens behind the courtains. The issue I had a week ago, when I opened this issue, went away. One day, I was able to buy the app again and I didn't have the entitlement anymore. I feel the backend guys apply some kind of automation on the testing purchases and consume them automatically, or maybe Google Play does something... don't know.

In addition, my old app where I implemented the inapp purchases by myself behaves differently to the one that uses RevenueCat. I don't recall exactly (and now I moved to another task so I don't have it that fresh) but the old version didn't recognise the purchase, while yours did. And it's strange, because my old app attacked the backend that also attacks the Google Play API like I think you do, but it gave different results.

Well, just sharing my experience. IMHO, we could just close this issue, and I could reopen it if I arrive to the same situation.

Thank you so much for your support! 👍

aboedo commented 2 years ago

@rocboronat thanks for the update, and for sharing your experience!

I'm closing this for now, but don't hesitate to get in touch again if you run into any more issues!

armandojimenez commented 2 years ago

Happening the same for me. If a user buys Lifetime in-app purchase, and then I refund him via RevenueCat or Play Console, the entitlement stays