#k3davis

1 messages · Page 1 of 1 (latest)

brittle sableBOT
wet sun
#

Hi 👋 there won't be a Payment Method ID attached to the Setup Intent after the request to create the Setup Intent, the Payment Method and its ID will not be generated until the confirmation of the Setup Intent.

But you're on the right track, once the Setup Intent has created a Payment Method, you can retrieve the Setup Intent and inspect the payment_method field to find the ID of the related Payment Method.

If you want to retrieve the full contents of the Payment Method object inline with the Setup Intent, then you can use the expand parameter to do so.

vapid moss
#

expanding the payment_method, if i'm reading the docs right, only returns a string. Is there another param I need to look at to see the payment method object as a whole (when it's available)?

wet sun
#

By default the payment_method field only contains a string with its ID, using expand changes that and returns the entire object inline instead of just its ID.

vapid moss
#

ooh I see, so I get the ID (when it's there, I understand that part) when I don't expand, but if I expand I get the whole payment object inline?

wet sun
#

Exactly

vapid moss
#

aha, that's very helpful. thanks!

wet sun
#

Any time!