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.

How can I handle the case of "Slow test card, declines after a few minutes"

See original GitHub issue

I am developing an Android app using Android Billing Library.

implementation 'com.android.billingclient:billing:2.1.0'

There are 4 test card options.

  1. Slow test card, approves after a few minutes
  2. Test card, always approves
  3. Test card, always declines
  4. Slow test card, declines after a few minutes

In the case of 1, “onPurchasesUpdated” callback method was called. So I can handle it.

But in the case of 4, there is no response from the play store library. “onPurchasesUpdated” callback was not called… (I waited more than 5 min…)

How can I handle case 4? I can handle others.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
DonovanPhoenixcommented, Aug 2, 2020

I have the same issue. On launchBillingFlow you get a BillingResponseCode.ITEM_ALREADY_OWNED. the purchase returns PurchaseState.PENDING. If you consumeAsync immediately after its response is BillingResponseCode.DEVELOPER_ERROR, but after a few minutes (or whatever delay the transaction takes to fail) you can consumeAsync again then it returns BillingResponseCode.ITEM_NOT_OWNED, now you are allowed to retry the launchBillingFlow again. not complicated or misleading at all, good job google

0reactions
zenanhucommented, Feb 19, 2020

@yoonhok524 After the pending transaction is expired, “onPurchasesUpdated” is not called, so you don’t need to handle this case. Just like this transaction never happened, user didn’t pay and developer didn’t grant entitlement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Android BillingClient v2 slow credit card test never ...
It works fine with "Credit card approves after a few minutes", but with "Slow credit card, rejects after a few minutes" the purchase...
Read more >
Handling "Slow test card, declines after few minutes" android ...
I have trouble detecting the “Slow test card, declines after a few minutes” case when testing from an Android device.
Read more >
Unable to Test Google Play Slow Card Payments - Unity Forum
1. User buys a non-consumable item with "Slow Test Card, declines after a few minutes" option; 2. The app shows a message saying...
Read more >
Test your Google Play Billing Library integration
Test a purchase with a declined slow test card. Make a purchase with a delayed form of payment "Slow test card, approves after...
Read more >
Use "SLOW TEST CARD" for purchases - MOBILE IAP -
1.Slow test card, approves after a few minutes · 2.Test card, always approves · 3.Test card, always declines · 4.Slow test card, declines...
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