-
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
Get default payment method on the UI side #1977
Comments
@mansoorshahsaid can you help me understand how you're using The stripe-ios SDK docs recommend to no longer use this property |
Ah thank you for your response, I'll upgrade to the new SDK version on iOS for the pre-selection of the last payment. On the Android side, do we have anything similar? Can the SDK pre-select my last payment? |
@mansoorshahsaid I'm still not clear what "pre-select my last payment" means. Do you mean have the SDK show something in the UI that you provide, or have the SDK up the last payment used for a given customer? |
Hey I came across the same problem. The problem is, PaymentSession needs to be persisted across user session. I've implemented the listener as follows
Now what I need to implement is whenever user launches this Activity either by navigating from the other activities or even launching a new instance of the app, onPaymentSessionDataChanged should be called to preset the last selected payment method and update the UI |
@mshafrir Hey sorry for the late response. You pointed out how the new iOS version of the Stripe SDK recommending not to use If you want to check it out, this is the feature I'm talking about on iOS: stripe/stripe-ios#1445 It would be great to have the same feature on Android! Currently there is no object that stores the last payment method. |
@mshafrir Hey sorry any update on this? |
@mansoorshahsaid @Wajahat-Jawaid if I understand correctly, when a customer selects a payment method (and potentially completes a purchase), and then later comes back to make another purchase, that payment method should be persisted and then made accessible? Maybe via something like |
@mshafrir-stripe |
@mshafrir-stripe Exactly, the payment method should be persisted when the user comes back to make another purchase. It was previously implemented on iOS with While having |
@mansoorshahsaid @mshafrir-stripe It would be great to have the same in Android SDK. |
Summary When a customer starts a new `PaymentSession`, if they have previously selected a payment method (determined via `PaymentSessionPrefs`), fetch the full `PaymentMethod` object from the API and update the `PaymentSessionData`. This behavior will only be triggered when `PaymentSessionConfig.shouldPrefetchCustomer == true`. Motivation Fixes #1977 Testing - Add unit tests - Manually verify
Summary When a customer starts a new `PaymentSession`, if they have previously selected a payment method (determined via `PaymentSessionPrefs`), fetch the full `PaymentMethod` object from the API and update the `PaymentSessionData`. This behavior will only be triggered when `PaymentSessionConfig.shouldPrefetchCustomer == true`. Motivation Fixes #1977 Testing - Add unit tests - Manually verify
Summary
Any way to get the default payment method and then set it on UI side? On iOS, it is possible by setting
paymentContext.defaultPaymentMethod = "card_token_id"
and then by doing that it reflects it on the UI side. Calling
let card = paymentContext.selectedPaymentOption
gets the correct card along with its information.
SDK version
12.8.0
Other information
On iOS we can do
paymentContext.defaultPaymentMethod = "card_token_id"
then
let
card = paymentContext.selectedPaymentOption
is that possible on Android?
The text was updated successfully, but these errors were encountered: