-
Notifications
You must be signed in to change notification settings - Fork 644
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
Add setup_future_usage
for saved Link
payment methods from PM and passthrough mode.
#8117
Conversation
Diffuse output:
APK
DEX
|
abstract fun create(paymentMethod: PaymentMethod): T | ||
abstract fun create( | ||
paymentMethod: PaymentMethod, | ||
requiresSaveOnConfirmation: Boolean = false, |
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.
Do we have tests for passing the right value into this?
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.
Added some network tests for ensuring the value is properly passed in PM and passthrough mode.
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.
Is it possible to have unit tests as well?
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.
Added unit tests in PaymentSheetViewModel
.
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.
can you add something to the description about what the new behavior is? I think we discussed this a bit in a call last week and one of the possible fixes leads to duplicate payment methods showing up in some cases. It'd be nice to know if that's this fix and how this fix works
...et/src/test/java/com/stripe/android/paymentsheet/DefaultIntentConfirmationInterceptorTest.kt
Outdated
Show resolved
Hide resolved
setup_future_usage
for saved payment methods from passthrough mode.setup_future_usage
for saved payment methods from PM and passthrough mode.
paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/LinkTest.kt
Outdated
Show resolved
Hide resolved
abstract fun create(paymentMethod: PaymentMethod): T | ||
abstract fun create( | ||
paymentMethod: PaymentMethod, | ||
requiresSaveOnConfirmation: Boolean = false, |
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.
Is it possible to have unit tests as well?
setup_future_usage
for saved payment methods from PM and passthrough mode.setup_future_usage
for saved Link
payment methods from PM and passthrough mode.
2428cf1
to
377b96f
Compare
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.
are there existing tests for a different PaymentSelection.CustomerRequestedSave option for FlowController?
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 logic for this actual is handled inside its PaymentSheet
variant view model PaymentOptionsViewModel
. Added some tests there.
paymentsheet/src/test/java/com/stripe/android/paymentsheet/PaymentSheetViewModelTest.kt
Show resolved
Hide resolved
paymentsheet/src/test/java/com/stripe/android/paymentsheet/LinkHandlerTest.kt
Outdated
Show resolved
Hide resolved
…ssed to `IntentConfirmationInterceptor`
7a055b9
to
fc7a139
Compare
Summary
Add
setup_future_usage
for saved payment methods from PM and passthrough mode.Currently, we assume that paying with saved payment methods (using
PaymentMethod
objects) meant that the payment method was already attached to the customer. We recently found out that Link was not saving payment methods to the customer account due to a limitation from the Mobile SDK's continued usage of ephemeral keys over customer sessions.This PR adds behavior for allowing payment methods saved on Link to also be saved on the customer's account so that they can be reused by the customer through Elements UI interfaces as well as expected when the customer asks to save a payment method through
PaymentSheet
.When we move to
CustomerSession
, Link will automatically save the payment method on both Link and their Stripe customer's account rather than need to implement a solution on the client side.Motivation
Fixes an issue in passthrough mode where a payment method saved through Link signup is not saved in as a customer payment method.
Testing