-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow test card is approved but should decline #140
Comments
This issue looks like related to handling pending purchases. Currently, I'm not sure what to do with it. |
The issue #199 you mentioned is about whether you can see the 4 testing options. It was closed as the OP eventually saw the 4 options later. My issue is different as it is about the unexpected result when pushing "Slow test card. Declines after a few minutes" |
Um. I think I am still confused about your expectations. Could you record some gifs for me to understand the problem for others who would wish to help you out? |
So as of this issue i've updated my listener from
To
But when one of the 2 "Slow test card..." options are selected
Googling the error leads me to a similar issue from the react-native-iap
The problem is if the "Slow test card. Declines after a few minutes" is selected and the user quits and resumes the app sometime during these "several minutes", the awaiting purchase is recognised as a successful purchase in _getPurchases() which is called when resuming. Here is my code for _getPurchases():
|
To be clearer, I've made a repo here if anyone wants to try to reproduce this issue. The repo has its own issue here which is similar to this one. The app has a list of non-consumables you can purchase (smiley faces) check out the readme for more details and screenshots. The readme also has detailed instructions on how to set up. |
This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days. |
Does anyone have a solution? This issue also happened on official flutter in-app purchase package |
@KazakovKirill |
I think the delayed confirmation should be handled with 2 results on listener: 1st a timeout (duration as an optional parameter) and 2nd the usual return (success or error). This timeout result could be handled in the App to show slow connection. Should the App be closed before the 2nd (delayed result), getPastPurchases would get unfinished transactions. |
I think I might be running into this problem. On Android, I made a purchase a couple days ago with the slow decline card. Is this the behavior you all are seeing? |
Version of flutter_inapp_purchase
flutter_inapp_purchase: ^2.0.5
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
When clicking "Slow test card, declines after a few minutes" I'm expecting my app to wait until there is a result, in this case declined. I'm testing a non-consumable iap.
Actual behavior
It seems the purchase is accepted as the user has access to purchased goods immediately after clicking "Slow test card, declines after a few minutes". Not seeing any update to the purchase after several minutes (i.e. from the debug console after several minutes)
Tested environment (Emulator? Real Device?)
Real Device
Steps to reproduce the behavior
When user clicks the button in the app to open the purchase dialog for the item
To initialise billing:
When "Slow test card. Declines after a few minutes" is pressed the console reads
Notice that purchase-updated is called which runs the code in the stream:
FlutterInappPurchase.purchaseUpdated.listen
In my code in this stream i call
setFullSolutionOn
which saves the purchase in my local database and sets the UI so the user knows the item is purchased. But this happens immediately. How can i wait till the purchase is processed?I don't see any later calls to purchase error i.e.
FlutterInappPurchase.purchaseError.listen
but i'm not sure if this is supposed to run.
The text was updated successfully, but these errors were encountered: