#Muritz

1 messages · Page 1 of 1 (latest)

rancid smeltBOT
wraith stump
#

Hello!

#

Can you tell me more about where you are stuck/confused exactly?

pine hull
#

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

wraith stump
#

Okay let's back up a sec

#

Are you following a specific guide or doc?

pine hull
#

That's the issue, the stripe doc for creating card tokens only has Nodejs code example

wraith stump
#

Which doc?

#

Can you link it?

wraith stump
#

Ah okay. So you are just looking at our API reference

#

That is our basic guide to taking a payment using Payment Element

pine hull
#

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

wraith stump
pine hull
wraith stump
#

👍

pine hull
#

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

wraith stump
#

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

pine hull
#

oh ok, thanks again