#victoria.fabris - card details for subscription
1 messages · Page 1 of 1 (latest)
Hello, can you send me a link to the doc that you are following?
And just to confirm, the end goal here is to allow one of your users to start a subscription by inputting their card details on your site?
Im following this link https://stripe.com/docs/billing/subscriptions/overview to understand how things work and this one https://stripe.com/docs/api/subscriptions to know how to create the objects
yeah, actually this is going to be a mobile app. I want to each client on my app to have a stripe customer, that when they make a purchase, they cand send their card details and this is going to be saved for a future purchase
And yes, the purchase is going to be through subscription
Have you seen this guide yet? This gives more of a step by step on how to create the subscription and collect payment details https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
Thank you for the clarification. You can certainly do that. It sounds like you are doing this on your own custom checkout page, for that we typically recommend creating the Subscription object for the customer first and then using our Elements frontend components to collect the payment details and pay the Subscription's first PaymentIntent
Is this helping you get closer to the answer? I feel like I am throwing a lot out
yeah, im doing it very customized. Im going to see if the elements in the frontend will help me with that
But in general, in the backend im going to send a requisition to the frontend, and the card details is not going to come to the backend, right?
this is how my code is right now, im hard coded the card details just to make sure this works in tests
But i will not have this full access to the details when on production, right? so how can i set in the Customer.create the payment_method?
So if the user is on your app when the payment is getting made, we actually recommend making the Customer+Subscription objects first, then when the user makes payment on the frontend with the Payment Element, the card will be automatically attached to the Subscription/Customer objects
You could do a flow where the frontend created a token and sends it to the backend for you to do more things from there, but we typically recommend the method outlined in that doc as it is more flexible and straightforward.
Oh, ok!
Nice, that was the exactly point
I think i have more questions about this flow, but i will test first and then come back here. Thank you so much!
Great to hear that this helped you move forward, happy to answer any questions as they come up.