Skip to content
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

[BUG] [PaymentSheet] Payment gets failed on back press. #6098

Closed
fbarthelery opened this issue Jan 20, 2023 · 3 comments · Fixed by #6142
Closed

[BUG] [PaymentSheet] Payment gets failed on back press. #6098

fbarthelery opened this issue Jan 20, 2023 · 3 comments · Fixed by #6142
Labels

Comments

@fbarthelery
Copy link

Summary

Similar to #5844 (I could not reopened), if user presses back button in the middle of processing, the PaymentSheetActivity may finish before processing complete and the result intent will not be set. PaymentSheetContract.parseResult() will then set a PaymentSheetResult.Failed while backend will get a confirmed payment.

stripe-android: 20.18.0

SDK classes

PaymentSheet, PaymentSheetActivity

Other information

I think the fix from #5848 has been lost with #6012.
From what I understand, BaseSheetActivity.onBackPressedCallback is only enabled when the viewmodel is not processing. So when you click the buy button, the translucent PaymentLauncherConfirmationActivity is launched and handle onBackPressed while confirming payment.
I think there is a small window after PaymentLauncherConfirmationActivity is destroyed, where BaseSheetActivity receives onBackPressed event and the onBackPressedCallback is not enabled.

@tillh-stripe
Copy link
Collaborator

HI @fbarthelery! Thanks for submitting this. We’ll take a look and see how we can fix this.

@jaynewstrom-stripe
Copy link
Collaborator

@fbarthelery
Copy link
Author

👍 I cannot reproduce it on v20.19.1 Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants