android-inapp-billing-v3 icon indicating copy to clipboard operation
android-inapp-billing-v3 copied to clipboard

Fix user canceled

Open max-critcrew opened this issue 2 years ago • 3 comments

See: https://github.com/anjlab/android-inapp-billing-v3/issues/516

fixed various issues that caused the payment flow not call the listeners (e.g. when the user canceled or item was unavailable, etc.)

Some of the additionally triggered listeners like developer error might trigger double now, but better double then not receiving the errors. If any library author could double check that'd be awesome.

max-critcrew avatar Feb 02 '22 17:02 max-critcrew

@max-critcrew can you please clean up all the extra changes in the PR? (anything except BillingProcessor changes?) Also do ming explaining what error codes will 'double'?

serggl avatar Feb 03 '22 06:02 serggl

@serggl Without the extra changes, it wouldn't compile on https://jitpack.io/ - so these are necessary in order to make it work for testing. Do you know any other way how I can make it work?

Absolutely agree about the BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED that was unnecessary, I removed that.

About possible double issues: I am not entirely sure which of the errors that I am catching here and calling reportBillingError for are also catched otherwise. I'd expect that the creators of the plugin also tested some of these and made some of these trigger. I know for sure that the DEVELOPER_ERROR can trigger sometimes. Therefore, I am not certain which errors now might trigger twice since. Since it's not entirely clear which errors come up here and which ones were already catched and reported to the listeners, I chose to better propagate errors like DEVELOPER_ERROR twice than not at all.

max-critcrew avatar Feb 09 '22 08:02 max-critcrew

@max-critcrew this project is published via maven central, so these extra changes are not required. Also the licence key in the sample project does not really needs to be changed to compile, right? The ideal PR should only contain changes related the bug fix, nothing extra. Happy to merge this when you'll clean up this a little

serggl avatar Feb 10 '22 08:02 serggl