#eskimo - Elements customization
1 messages · Page 1 of 1 (latest)
So i'm looking at https://stripe.com/docs/elements/appearance-api
And I see const elements = stripe.elements({clientSecret, appearance});
Where does clientSecret come from?
That should come from the response your server receives after creating or retrieving a PaymentIntent
Ok, so I'm just using elements to createToken
So I don't want to have to query my server just to get something like that
I'm currently just initiating as elements = stripe.elements();
Elements do NOT create tokens client-side...
Elements use a secure iFrame to send data to Stripe's servers to create the information there, which is retrieved by your server (generally) as a paymentMethod
That's what I'm using
That works, and is all fine and dandy
But for customizing the looks of it, it looks like i need to pass appearance
When creating the elements
But I'm not going to be passing a clientSecret
How do I do it?
Ah. The deprecated token approach.
Ah, I think I see the issue
I'm really tempted to just go back to v2
The Appearance API cannot be used with individual elements, only the PaymentElement
Style can be used with individual elements: https://stripe.com/docs/js/appendix/style
Personally, I'd recommend abandoning tokens altogether in favor of the SetupIntents/PaymentIntents.
Well
Here's my opinion
It's terrible because 1, it looks like shit because they take time to load
2, having to query my server first just to get a secret just to send something to you, is garbage
3, the nightmare this is just to customize the look of it
This is a terrible bloated setup and has terrible UX
It's a huge downgrade
Maybe it helps noobs, but it makes it a pain for anyone that actually codes to do anything
I'm tempted to just use v2, but I know eventually you'll cut that off and I'll be forced to use this garbage anyway, so I feel like I have no choice
v2 is perfect
You're reinventing the wheel in an overcomplicated bloated way, it's really bad