#zeez5658
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
hi! that guide seems like exactly what you want.
You never create a PaymentMethod on the backend, since that would imply you have the raw credit card numbers in your backend code, which would put you in PCI scope. You create the pm_xxx on the frontend and can send the ID/object to the backend to use in API calls there, like in that guide.
was there a specific element or order that doesn't work for your purposes that you could expand on?
So basically my flow is as follows:
- Register form is submited
- validate all fields (inc credit card)
- Create stripe subscription
- Create account in my db
So essentially I want to ensure the stripe subscription and info in my db is created atomically
i.e. one isnt created without the other
I suppose you could only create the things in your database after the subscription is successfully set up.
but yes, there's no perfect solution here really, since you need to create a Customer cus_xxx object first, in all cases.
I can create the payment method before the customer though right?
Don't I have to link the pm to the customer for future payements
sure. (that's exactly what that guide does)
The guide creates the customer first. But good to know you can do it the other way around. Thankyou
the PaymentMethod gets added to the Customer by the action of confirming the Invoice's PaymentIntent in step 8
yeah I see the guide now. You don't have to create the Customer first anyway, you could do it in step 8 in the create-confirm-subscription route.
great, thankyou, appreciate the help