#dceron
1 messages ยท Page 1 of 1 (latest)
Hello! As far as I know PaymentSheet cannot modify default_source, as that's a legacy property and no longer recommended.
Ohh! Got it
Is there a new way to retrieve that information? (ie. the card selected with the blue check)
I want to add a button like:
(Current Method: **** 42424) -> When clicking it opens the PaymentSheet
(Current Method: None) -> Same behaviour
I'm using it just in the setup mode, and I may be using subscriptions, so I want to make sure that I'm always displaying/charging the method the user wants to pay with.
I think it generally selects the newest one, but let me see if we document this somewhere...
Thank you!
As far as I can tell we don't explicitly document the behavior anywhere. I'll flag this internally so we can improve that. I believe the PaymentSheet does take default_source and possibly invoice_settings.default_payment_method into account, as well as creation date, when determining which should be selected as the default.
Oh, got it!
Thanks! Will take a look into the invoice_settings object then
Appreciate your assistance
Yeah, make sure you test to confirm the behavior. I think there might be subtle implementation differences between platforms.
Looks like it's null
`invoice_settings {
custom_fields: null,
default_payment_method: null,
footer: null,
rendering_options: null
}`
Yep, it's not changing ๐ฆ
Hello, thanks @astral heath ๐
Okay getting confirmation but looks like we actually display the last PaymentMethod that was selected via the PaymentSheet. If one hasn't been selected yet, then we use the newest PaymentMethod added.
Yes, is it possible to retreive that same information you're displaying?
In case I want to show it somewhere else in my UI
Something like: "Your current payment method is: ****4444"
Ah no I don't think that is possible afaik
This is all handled internally in the SDK
And not exposed unfortunately
Oh, got it :/, and the default_source is now deprecated, right?
We were using that to achieve so before integrating the PaymentSheet in our app
Yes that's correct.
Generally if you are working with PaymentIntents directly then there isn't really a concept of a "default".
Got it! Is there a way then to let my users save their payment methods and select one as default?
And then charge that specific payment method later
You would mostly need to handle that yourself in your own UI.
We don't have a UI that does that for you.
So you could surface to them in your app which PaymentMethod is the "default" and you just keep track of that and then if there is an off-session charge later on you use that default.
Ok, makes sense!
Thanks for your time @astral heath ! ๐
Sure thing