#Muritz
1 messages · Page 1 of 1 (latest)
So... from the little i could grab, i think i need to install @stripe/stripe-js and @stripe/react-stripe-js npm packages (which i did) and i thought if i use the Elements provider to access the stripe object I could then access the stripe.token.create() method (not sure if that's correct though). I proceeded to call loadStripe from @stripe/stripe-js with mypublishable key but when i pass my clientSecret through the options object as specified in the doc, I'm get an "Invalid value for elements(): clientSecret should be a client secret of the form ${id}secret${secret}".
sorry about the mess, I'm fairly new to payment integration
That's the issue, the stripe doc for creating card tokens only has Nodejs code example
Ah okay. So you are just looking at our API reference
Instead, take a look at https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
That is our basic guide to taking a payment using Payment Element
You can also take a look at our quickstart: https://stripe.com/docs/payments/quickstart which has a basic code example for how to get this up and running
but what i really want to do is for my users to be able to add their cards for future subscription/payment
not necessarilly to accept payment right away
Then you want this doc: https://stripe.com/docs/payments/save-and-reuse
Thanks alot🤗 this seems to have what i need
👍
One more thing, if don't mind... the clientSecret i'm supposed to pass here is same as the one from stripe dashboard or is it created on the backend
That is your publishable key that you get from the Stripe Dashboard
The client secret is from the PaymentIntent that you create in the backend
oh ok, thanks again