-
Notifications
You must be signed in to change notification settings - Fork 659
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
Update the payment intent when save is unselected. #4291
Conversation
sealed class New : PaymentSelection() { | ||
abstract val paymentMethodCreateParams: PaymentMethodCreateParams | ||
abstract val shouldSavePaymentMethod: Boolean |
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.
iOS models this is as Boolean?
, where null
means .NoRequest
enum class UserReuseRequest { | ||
RequestReuse, | ||
RequestNoReuse, | ||
NoRequest |
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.
"User" can refer to either the merchant's users (i.e. customer) or Stripe's users (i.e. merchants). This should be renamed to "Customer" to avoid confusion.
nit: Rename to CustomerRequestedSave
? "Reuse" implies the customer is trying to reuse the payment method, but they're only saving it at this point for reuse. They may never actually reuse it.
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.
got it
e86e861
is CharSequence -> { | ||
if (value.isEmpty()) { | ||
compactParams.remove(key) | ||
} | ||
} |
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 worry if this will break something
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 did look at annotations and didn't see a particular reason why this is true. I am curious at @yuki-stripe If you have this similar functionality on iOS where you globally remove all spaces and null parameters from all requests?
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.
We don't have the "if 'empty' parameter -> don't send" logic. Not sure about spaces.
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.
This is technically a breaking change but probably zero impact in practice. We can call it out in the CHANGELOG?
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.
yep, added to the changelog already.
Summary
There are three states that a New PaymentSelection can be in: RequestSave, RequestNoSave, or NoRequest.
Motivation
Reproduction steps:
Actual: Card is saved to the customer.
Expected: Card is not saved
Testing