-
Notifications
You must be signed in to change notification settings - Fork 663
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
[MOBILESDK-3379] Fix Save and Continue button both visible in Manage Page #10557
Conversation
Diffuse output:
APK
|
@@ -64,7 +64,8 @@ internal class PrimaryButtonUiStateMapper( | |||
enabled = buttonsEnabled && selection != null, | |||
lockVisible = false, | |||
).takeIf { | |||
screen.showsContinueButton || selection?.requiresConfirmation == true | |||
screen.showsContinueButton || | |||
(selection?.requiresConfirmation == true && screen.showsMandates) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
showsMandates
seems unrelated to this behavior. We should either rename that param, or add a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking is that the need for a continue button is because we need to show a mandate before users confirm their choice of payment method.
I could rename it to something like
screen.showsMandatesForConfirmation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root cause of this issue is that USBankAccounts will always show the continue button on any page, because using a usBankAccount requires confirmation.
Since USBankAccount can be saved, a selected USBankAccount will cause the continue button to show on the ManagePage and the UpdatePaymentMethod Page incorrectly.
But there is one page where we can still select payment methods but don't need to show the continue button for them, SelectSavedPaymentMethods. It also happens to be a page where we showMandates. I figure that if we show the mandate on that page, we have to show the continue button to get a users implicit consent to the terms of usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense now that they'd always be the same. I think we should make the name something that makes this clear!
* where mandates are shown. | ||
*/ | ||
val needsUserConsentForSelectedPaymentMethodWithMandate = | ||
selection?.requiresConfirmation == true && screen.showsMandates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we need to rename screen.showsMandates
to make it clear what it does here.
Summary
Modify PrimaryButton uiState logic that determines if primary button should be shown.
If PrimaryButton.uiState is null, then primary button is not shown
From
To
The root cause of this issue is that USBankAccounts will always show the continue button on any page, because using a usBankAccount requires confirmation.
Since USBankAccount can be saved, a selected USBankAccount will cause the continue button to show on the ManagePage and the UpdatePaymentMethod Page incorrectly.
But there is one page where we can still select payment methods but don't need to show the continue button for them, SelectSavedPaymentMethods. It also happens to be only page where we showMandates but don't showContinueButton. I figure that if we show the mandate on that page, we have to show the continue button to get a users implicit consent to the terms of usage, at least for USBankAccount.
Motivation
https://jira.corp.stripe.com/browse/MOBILESDK-3379
Fixing a bug where it was possible for users to show the continue button when editing a payment method.
Testing
Screenshots
Changelog
N.A.