#Hariharasuthan
1 messages · Page 1 of 1 (latest)
Hey there
So when using Elements you don't pass the values from the Elements directly
All you have to do is pass your cardElement
Like stripe.createToken(cardElement).then(function(result) { // Handle result.error or result.token });
Stripe.JS will grab the values from Card Element for you
Could you please provide me a code sample? Do we have any documentations in Stripe website for this?
Well let's back up
What are you trying to do exactly?
Are you just starting on a new integration?
Yes, new integration
in my website
want to enable card payment option from my payment form.
And you are okay redirecting to a payment form or you want it embedded in your site?
embedded in my site
Alright then the recommended flow would be to integrate Payment Element. You can see an integration guide here: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
And you can see a quickstart code sample here: https://stripe.com/docs/payments/quickstart
Thanks a lot