#ibgoldbergs
1 messages · Page 1 of 1 (latest)
Just reading through your flow.
My first thought would be to create the Customer first, then use a Setup Intent to both collect Payment Method details and attach the PM to the Customer in one API request.
We discuss that here https://stripe.com/docs/payments/save-and-reuse
Oh wait.
Actually I think you can do it all when creating the subscription.
Sorry, not all
But when you create the Subscription you can configure it to link the Payment Method used and set that as the default payment method.
You would use this parameter https://stripe.com/docs/api/subscriptions/create?event_types-payment_intent.payment_failed#create_subscription-payment_settings-save_default_payment_method
so this would just remove one step (setting paymentMethodId as default for customer)
👋
Stepping in as Snufkin needs to step away
Yes
You can set the default payment method via the above setting when you create the Sub
So you don't have to do that extra step
Can we add billing details to the paymentMethod at the same time as creating the subscription as well?
You add billing details to the PaymentMethod when you collect the PaymentMethod
What integration are you using?
Sounds like Card Element potentially?
Yes the card element
Trying to figure out how to make our endpoint much faster/optimized
Yep so with Card Element you can pass billing details via confirmCardPayment https://stripe.com/docs/js/payment_intents/confirm_card_payment#stripe_confirm_card_payment-with_element-payment_method-billing_details
Sure thing