#ironbeard-payment-method

1 messages ยท Page 1 of 1 (latest)

urban turtle
#

Hi there ๐Ÿ‘‹ it looks like that intent used a Source rather than a Payment Method, but I'm taking a closer look.

#

When you retrieve that Payment Intent, do you see a source field?

steel pendant
#

Hmm one sec

#

Yes, it returns card_1LA1ShCoTIfwbn28pLLlwNX6

#

This PaymentIntent comes from creating a Subscription in the dashboard

#

but usually I'll be creating a Subscription with the API, then confirming the payment intent using subscription.latest_invoice.payment_intent with the Card Element.

So, in that situation, should I be expecting source field or payment_method?

urban turtle
#

In this case, it's because the Customer that the Subscription was created for has a default_source set, and since the Subscription was created without a default_payment_method or default_source value, the system fell back on customer fields to use to pay the associated invoice.
https://stripe.com/docs/api/subscriptions/create#create_subscription-default_payment_method

For a newly created integration leveraging the Card Element, you'd be expecting a Payment Method to be provided.

steel pendant
#

Ahh, yes, that makes sense. Thanks ๐Ÿ™‚

urban turtle
#

Any time!

steel pendant
#

๐Ÿ™Œ๐Ÿ™Œ

#

One more question: is it possible to determine if a given PaymentMethod is the "default" one based on a stripe.PaymentMethod.retrieve(pm_id) call? Or do you need to, e.g., expand customer etc?

urban turtle
#

You'll need to look at the Customer object.

steel pendant
#

Gotcha, thanks!