#heshiebee-paymentintent

1 messages · Page 1 of 1 (latest)

hoary egret
#

hello, mind sharing the PaymentIntent ID?

also completed isn't a status on a PaymentIntent

#

do you mean status: succeeded ?

inner verge
#

correct

#

pi_3KnnU22R3n1Hr8Bq1bdvwOUG

hoary egret
#

thanks, lookiong

inner verge
#

Thx!

hoary egret
#

ah so

#

this is the legacy "Cards" vs the new PaymentMethods

Your Customer has a "Card" object attached to them, on their sources: field
and as a result, is their default_source as well

cus_LUn4RYlhtmaxmp

you created a Subscription without passing a default_payment_method: in that request

when you created this Subscription from the Dashboard, the Dashboard uses the Customer's default_source and that same is set on the PaymentIntent's source field.

inner verge
#

Aha, so if I would’ve used The stripe payment element I would’ve seen a payment method on the intent, correct?

hoary egret
#

well technically no, PaymentElement only confirms a PaymentIntent but it depends on what happened on the step of Subscription creation

in that, you can either pass default_payment_method: where the value can either be a PaymentMethod ID (like pm_123) or a Card ID like "card_345"

and then the PaymentIntent under the Subscription's Invoice will have the payment_method: field set

inner verge
#

And it’s assuming that a payment_method is present on the intent

#

How’s that?

hoary egret
#

yep so you need to pass the default_payment_method in that Subscription creation request

inner verge
#

But how can I if the customer hasn’t paid yet?

#

I’m following the above guide step for step

hoary egret
#

ah sorry I missed, so now I better understand

if you're following that guide, then you create a Subscription with payment_behavior: default_incomplete
like here: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription

and yep correct, you don't have a PaymentMethod at that time

then on your client_side, you PaymentElement to collect a PaymentMethod on the PaymentIntent that is created for that Subscription: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#collect-payment

and that should give you a succeeded PaymentIntent which has a payment_method on it (not source or Card object)

and then you can do this step to take that PaymentMethod and update it as the Subscription's default_payment_method: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#default-payment-method

Create and manage subscriptions to accept recurring payments.

inner verge
#

Awesome, thx!