#marcoscorporativo_56015
1 messages · Page 1 of 1 (latest)
Hello
Hii, you can helpme ?
(Sorry for english, i'm brazilian)
Yep happy to help.
So what you want to do is read through https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements first
That explains the Subscription flow, but for web
Then you want to replace the parts that discuss the Web frontend with https://stripe.com/docs/payments/accept-a-payment?platform=react-native
The summary is that you want to create a Subscription on your backend, then pass the latest_invoice.payment_intent.client_secret to your frontend to use in initPaymentSheet in order to complete the initial payment for the Subscription and save the added PaymentMethod.
So I need to only change the backend? I followed this initialization guide to do the front part, and it works normally, but not as a subscription.
Yep then you mostly just need to change the backend
Oh, nice! I understand now. I'm going to try it and talk to you if it works.
Yep sounds good. Give it a try and then reach back out if you need to!
men, help
What are the parameters that I need to pass on the front for the initPaymentSheet ?
in the backend i'm return only this:
res.send({
subscriptionId: subscription.id,
ephemeralKey,
clientSecret: subscription.latest_invoice.payment_intent.client_secret,
});
You need the ephemeral key, Customer ID, and client secret
So looks like you are sending the Subscription ID instead of Customer ID right now
aaaaaaaaaaaaaa, it's working, VERY THANKS