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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show mandate if being reused #3744

Closed
wants to merge 2 commits into from
Closed

Conversation

porter-stripe
Copy link
Collaborator

@porter-stripe porter-stripe commented Jul 2, 2024

Summary

  • For saved payment methods like SEPA that show a mandate, we were not showing them. We need to take into account if the payment method is being re-used as well.
  • We need a separate fix for US bank account since the mandate isn't technically a part of the form

Horizontal for reference

Simulator Screenshot - iPhone 15 - 2024-07-02 at 12 05 19

After fix

Simulator.Screen.Recording.-.iPhone.15.-.2024-07-02.at.12.05.40.mp4

Motivation

馃悰

Testing

  • Manual

Changelog

N/A

@porter-stripe porter-stripe marked this pull request as ready for review July 2, 2024 19:13
@porter-stripe porter-stripe requested review from a team as code owners July 2, 2024 19:13
Comment on lines +50 to +53
if form.collectsUserInput && !state.isReusing {
// If it collects user input and is not being re-used, the mandate will be displayed in the form and not here
return
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does isReusing mean? Does it mean like, whether or not we have a saved payment method selected? Maybe rename isSavedPaymentMethod?

IMO we should branch based on if it's a saved PM or not. If it's not, trigger the old form-based code. If it is, switch on the payment method type. The "generate form" logic just doesn't hold up for saved PMs.

if isSavedPaymentMethod {
  switch paymentMethodType {
   ... manually build mandates
  }
} else {
  ... original form-generating code
}

Copy link
Collaborator

@yuki-stripe yuki-stripe left a comment

Choose a reason for hiding this comment

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

Can we add tests for this, too? We can expand testDisplaysMandateBelowList.

@porter-stripe
Copy link
Collaborator Author

Closing from our Slack convo @yuki-stripe

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.

None yet

2 participants