cordova-plugin-purchase
cordova-plugin-purchase copied to clipboard
[ANDROID] Unable to detect "slow test card, declines after a few minutes" case
system info
Ionic:
Ionic CLI : 5.4.9 Ionic Framework : @ionic/angular 4.9.0 @angular-devkit/build-angular : 0.801.3 @angular-devkit/schematics : 8.1.3 @angular/cli : 8.1.3 @ionic/angular-toolkit : 2.0.0
Cordova:
Cordova CLI : 9.0.0 ([email protected]) Cordova Platforms : android 8.1.0, ios 5.1.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.1, (and 10 other plugins)
Utility:
cordova-res : 0.10.0 native-run : 0.3.0
System:
Android SDK Tools : 26.1.1 (C:---\tools_r25.2.3-windows) NodeJS : v12.18.3 (C:\Program Files\nodejs\node.exe) npm : 6.11.3 OS : Windows 10
The devices I'm using to test have Android 7 and Android 11
Expected behavior
My code has handlers for when product is loaded, approved, verified, cancelled, and error. It is also catching errors after calling "order(product)".
This is enough to handle all other android test cases ("test card approves", "test card declines", and "slow test card, approves after a few minutes").
I would assume the "slow test card, declines after a few minutes" case should be detected and handled similarly. Either as "cancelled" or "error".
Observed behavior
"Slow test card, declines after a few minutes" case when testing from an Android device does not trigger any cancelled/error status. So there is no way for me to notice it and this leaves the user in an endless loading screen.
Am I missing something? Should this case be handled differently than the rest? I don't like the idea of adding some sort of timeout, since it doesn't guarantee working every time, plus it could mess up with the "slow card, approves after a few minutes" case.
I've read some forums pointing that this may be a problem to be solved by Android, but there's also not many people complaining which leads me to believe there might be a workaround to handle it.
Steps to reproduce
- Initiate a purchase process
- On the Android menu, select "test card, declines after few minutes" case
I'm experiencing the same issue. I'd greatly appreciate any kind of support / advice on this. All other Android test payments are working, it's just the slow decline that creates an issues.
To add to this, there is some strange behaviour here. If I place an order using a slow card that declines and leave the app open, it doesn't fire the cancelled event. If however I place the order, close the App, re-open the App, and wait, I get a "cancelled" event fired which is what I would expect. So it feels like some kind of state issue in the plugin?
and more! if I move the app to the background, and then bring it to the foreground again, I suddenly get the cancelled event fired and my handler takes it from there....
This problem still exists in version 13.6.0! Select "Slow test card, declines after a few minutes", you'll get receipt with transaction "initiated". The payment declined message is not comming, and the transaction stays in "initiated" state. Only after restart, the receipt disapears.