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

Set canCancelSource=true in StripeBrowserLauncherViewModel result #3681

Merged
merged 1 commit into from
May 5, 2021

Conversation

mshafrir-stripe
Copy link
Collaborator

Summary

In PaymentAuthWebViewActivityViewModel#cancellationResult we set
canCancelSource=true and conditionally set
shouldCancelIntentOnUserNavigation.

In StripeBrowserLauncherViewModel, we have no way to tell what
action the customer took during 3DS1, whether cancel, succeed, or fail.
That means the source is always cancellable.

Motivation

Ensure PaymentIntent and SetupIntent objects are correctly cancelled.

Testing

  • Added tests
  • Modified tests
  • Manually verified

In `PaymentAuthWebViewActivityViewModel#cancellationResult` we set
`canCancelSource=true` and conditionally set
`shouldCancelIntentOnUserNavigation`.

In `StripeBrowserLauncherViewModel`, we have no way to tell what
action the customer took during 3DS1, whether cancel, succeed, or fail.
That means the source is always cancellable.
* We don't want to cancel if required actions have been resolved and the payment is ready
* for capture.
*/
private fun shouldCancelIntent(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, great to see this as a function

Copy link
Contributor

@michelleb-stripe michelleb-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mshafrir-stripe mshafrir-stripe merged commit 3c48448 into master May 5, 2021
@mshafrir-stripe mshafrir-stripe deleted the fix-3ds1-custom-tabs branch May 5, 2021 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants