#marcoscorporativo_56015

1 messages · Page 1 of 1 (latest)

grand wrenBOT
edgy parrot
#

Hello

desert dirge
#

Hii, you can helpme ?
(Sorry for english, i'm brazilian)

edgy parrot
#

Yep happy to help.

#

That explains the Subscription flow, but for web

#

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.

desert dirge
#

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.

edgy parrot
#

Yep then you mostly just need to change the backend

desert dirge
edgy parrot
#

Yep sounds good. Give it a try and then reach back out if you need to!

desert dirge
#

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,
});

edgy parrot
#

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

desert dirge
#

aaaaaaaaaaaaaa, it's working, VERY THANKS