question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Even if the user has refunded, it still recognizes the purchase.

See original GitHub issue

`Inventory() { }

/** Returns the listing details for an in-app product. */
public SkuDetails getSkuDetails(String sku) {
    return mSkuMap.get(sku);
}

/** Returns purchase information for a given product, or null if there is no purchase. */
public Purchase getPurchase(String sku) {
    return mPurchaseMap.get(sku);
}`

The user refunded, but getPurchase returns a non-null value.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
fab327commented, Dec 19, 2019

I agree with @githubsoooh , Digging into the code v2.0.3, it reads the following:

/** Returns the state of purchase. */
  public @PurchaseState int getPurchaseState() {
    switch (mParsedJson.optInt("purchaseState", PurchaseState.PURCHASED)) {
      case 4:
        return PurchaseState.PENDING;
      default:
        return PurchaseState.PURCHASED;
    }
  }

There is basically no way of handling canceled/refunded purchases…

0reactions
adrcotfascommented, Mar 17, 2021

What if we don’t want to use a backend to check refunds/cancelled purchases?

I found a workaround and wrote the details here: https://issuetracker.google.com/issues/73982566#comment62 Can you folks working on the Billing Library confirm if this is safe or not until you’ll provide a real solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage your app's orders and issue refunds - Play Console ...
If you see a refunded order that you don't recognize, it may have been refunded by Google. These refunds are issued as a...
Read more >
Google In-App Purchase are always refunded - Stack Overflow
Failure to properly acknowledge purchases results in those purchases being refunded.
Read more >
Google payments are being automatically refunded.
I made a purchase from an app that has already been distributed. Purchases were made in the same way as regular users in...
Read more >
Returns & Refunds - Shopping Help - Education - Apple
Find out how you can return an item, how long the refund process takes, what to do if your invoice is not with...
Read more >
purchases.subscriptions.refund | Google Play Developer API
Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found