#eskimo - token
1 messages · Page 1 of 1 (latest)
Hi there. So with v3, we pivoted to Elements, which essentially just are Stripe-built forms used to collect payment method details. This handles all PCI compliance concerns. Also, with the newer pattern, we recommend using Payment Methods instead of tokens: https://stripe.com/docs/payments/payment-methods
However it's still doable to use tokens: https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement
You would just pass the element in
Which is the object of the form used to collect card details
So I can't use my own forms anymore?
Let me check with a colleague the best way to do this if you use your own forms. It may have to be done on the backend
You can continue to use v2, we don't currently have a date for deprecating it so it will not be soon. If/when we do decide it will be deprecated, we will proactively reach out about it and you will have plenty of time to switch off of it
Ok, did you find out about using my own form?
For consistency of design I'd prefer to use my own
v3 is built around Elements as which has lower PCI requirements than v2 and handling the card details directly which has higher requirements. So, it's recommended to go with Elements. There's still plenty of room to have a custom payments form with Elements, as you can use "split" Elements (which is combining the different types of Elements). We talk about that a bit on this page: https://stripe.com/docs/payments/payment-card-element-comparison. It is possible to have your own form, but the PCI compliance requirements are strict on that (you would be passing the PAN to your backend for processing). So we couldn't advise on how to achieve that properly (it would be up to you to obey all regulations on that). We built Elements to eliminate the woes of PCI compliance
PAN?
ah that just means card number
Yeah unfortunately v3 doesn't support tokenization in the same way v2 does
Have you seen our split card element? https://github.com/stripe/elements-examples/tree/7cb00ab571c98a68c72bb67243d35cff3e2b560e#example-2
Stripe Elements examples. Contribute to stripe/elements-examples development by creating an account on GitHub.
It's still a mess
Having to do an api call to my server to create a "setup intent" is stupid
You can also create tokens/PaymentMethods directly with that. SetupIntents are very helpful for managing state and things like 3DS though
Oh?
Whoever writes these docs needs a new job
So bloated and they basically miss all the important points
Yeah you can just pass in any of the split elements to the createToken call https://stripe.com/docs/js/tokens_sources/create_token?type=cardNumberElement
Here's an example project that uses the split element that you can use for reference https://glitch.com/edit/#!/pi-split-elements?path=views%2Findex.html%3A1%3A0
Oh I see
So you make an element then "mount" it to a div id
Got it
Ok, I'll give this a shot, maybe it's not so bad
But then I can still attach the token to a customer for future use?
Yep yep, same Token as always
Ok, this seems alright then. Thanks.
Of course, glad v3 can help you here
I still kinda see it as a downgrade 😛