I have seen examples of how to use the Card Component alongside the Stripe API to create a customer and attach a subscription, but I do not understand how to do this with the Payment Element.
I have a React app that essentially one page has the full sign-up and payment flow. I have:
My basic understanding is that Payment Element needs a Payment Intent, and I don't understant how I can create one related to a subscription plan, and essentially without the customer details. Is there a way to use Payment Element, then get some sort of token and then create the customer and add the subscription? (I know you can do this with the Card Element, but I want to do this with the Payment Element ideally)
You can take a look at how to use the Payment Element for Subscriptions on this page: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
A high level overview of the steps are:
payment_behavior=default_incomplete
and you would expand either latest_invoice.payment_intent or pending_setup_intent
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.