#datapata - Subscriptions + Elements

1 messages · Page 1 of 1 (latest)

wet silo
#

Hi there! Give me just a few minutes to get up to speed

#

So, I wouldn't recommend trying to attach the Payment Method during step 6, simply because your customer could abandon the payment flow, which would require a lot of meticulous error-handling.

Rather, I would suggest having an endpoint just listen for the payment_intent.succeeded Event and program your handler to make additional API calls to attach the Payment Method from there.

#

There isn't a way to get the Payment Method ID until after you confirm the Payment Method on step 6, because that is the first time the card details are actually being submitted to Stripe in that payment flow scenario.

runic marten
wet silo
#

I was hoping for an option in Elements or when creating the subscription that would make elements attach it if the payment succeeded.
Re. the above: attaching the payment method to the Payment Intent on success still happens, there's just not a way to set it as default on the customer without making another server-side API call.

runic marten
#

I see, thanks!