#AlexElba-billing

1 messages · Page 1 of 1 (latest)

lilac rapids
merry jacinth
#

Hello, so I am trying to follow tutorial , but can not figure out

#

where to add

#

createPaymentMethod

#

function call

lilac rapids
merry jacinth
#

so the create subscription is done server side not with js on client side?

#

await fetch('/create-subscription' ...

#

instead of doing a server side call to create subscription

lilac rapids
#

@merry jacinth your question was specifically with regards to creating the payment method - the payment method is created from the client with stripe.js. After the payment method is created, your client would make an API call to your server to create the subscription with the payment method id

merry jacinth
#

so to be clear for my steps Form -> Name, email, phone, price_id Submit -> 1) Ajax call to create a customer and return customer id 2) with customer id in javascriptipt create payment method 3) On successful payment do ajax call to create subscription

#

is this correct flow?

lilac rapids
#

yep sounds correct from a high level perspective