#dceron

1 messages ยท Page 1 of 1 (latest)

fast thunderBOT
woeful lodge
#

Hello! As far as I know PaymentSheet cannot modify default_source, as that's a legacy property and no longer recommended.

grim pike
#

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.

woeful lodge
#

I think it generally selects the newest one, but let me see if we document this somewhere...

grim pike
#

Thank you!

fast thunderBOT
woeful lodge
#

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.

grim pike
#

Oh, got it!
Thanks! Will take a look into the invoice_settings object then

#

Appreciate your assistance

woeful lodge
#

Yeah, make sure you test to confirm the behavior. I think there might be subtle implementation differences between platforms.

grim pike
#

Looks like it's null

`invoice_settings {

custom_fields: null,
default_payment_method: null,
footer: null,
rendering_options: null
}`

#

Yep, it's not changing ๐Ÿ˜ฆ

astral heath
#

๐Ÿ‘‹

#

stepping in as Rubeus had to step away

grim pike
#

Hello, thanks @astral heath ๐Ÿ™‚

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.

grim pike
#

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"

astral heath
#

Ah no I don't think that is possible afaik

#

This is all handled internally in the SDK

#

And not exposed unfortunately

grim pike
#

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

astral heath
#

Yes that's correct.

#

Generally if you are working with PaymentIntents directly then there isn't really a concept of a "default".

grim pike
#

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

astral heath
#

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.

grim pike
#

Ok, makes sense!
Thanks for your time @astral heath ! ๐Ÿ™‚

astral heath
#

Sure thing