#rssv
1 messages ยท Page 1 of 1 (latest)
Which style parameters are you referencing?
var style = {
base: {
backgroundColor: '#363636',
padding: '10px',
':hover': {
backgroundColor: '#ffffff'
}
},
};
Also, any reason why you're not using Payment Element? It's far more customisable: https://stripe.com/docs/elements/appearance-api
And you get all the LPM support (like iDEAL) in the same Element
I'm lost at this point ๐ฆ
This API is like ocean, never ends...
Thanks for the recommendation
Well, let's take a step back: what are you trying to do with Stripe exactly?
Customizing its elements to fit my website design
My first intention was using same class, but I can't due it's in iframe
So I tried to stylize it using same CSS, but apperently it wasn't supporting all of the CSS features
Then if you want more customisation and styling you should use Payment Element. Plus you get wallets and LPMs for free, unlike with Card Element
Alright
It requires clientSecret, does that stands for secret key?
No, that's the client_secret returned from the Payment Intent you create
So unlike cardelement, I need to first create intent?
Are we talking about sending request to my server then my server send request to Stripe (for creating this Intent thing)
If so, the Payment Element wouldn't suit for my case because website is offering 3 different payment method
That is the default flow, yes. But you can use a deferred intent flow which doesn't require the intent upfront: https://stripe.com/docs/payments/accept-a-payment-deferred
np!
How to style payment_element inputs? I couldn't find it in there https://stripe.com/docs/js/elements_object/create_payment_element
See ๐
You pass it to stripe.elements(): https://stripe.com/docs/js/elements_object/create#stripe_elements-options-appearance
const appearance = {
theme: 'night',
variables: {
fontFamily: 'Sohne, system-ui, sans-serif',
fontWeightNormal: '500',
borderRadius: '8px',
colorBackground: '#0A2540',
colorPrimary: '#EFC078',
colorPrimaryText: '#1A1B25',
colorText: 'white',
colorTextSecondary: 'white',
colorTextPlaceholder: '#727F96',
colorIconTab: 'white',
colorLogo: 'dark'
},
rules: {
'.Input, .Block': {
backgroundColor: 'transparent',
border: '1.5px solid var(--colorPrimary)'
}
}
};
const parentOpt = {
mode: 'payment',
amount: 1099,
currency: 'usd',
apperance: appearance,
};
const elements = stripe.elements(parentOpt);
Doesn't apply the theme
Oh, my bad.
Are there any errors in your browser console?
Typo
apperance: appearance,
appeArance
I hope that was my question, sorry for keeping you busy.
Card-element has hideIcon attribute, but couldn't find it something similiar for payment-element.
How to hide card icons?
it's not possible today, that's not something we provide a configuration or customisation for
How to hide Country element?
you can use never on https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-address to hide the input, but you do need to then pass a value for country when you confirm the Intent, as it's required.
Does this data too much important? Can I send it by analyzing IP address (User might use VPN at this moment)
why not just leave it as default and let the user pick their country? it's easier and more accurate than trying to guess by IP address, and also it should be the country that their payment method is from, and they might be on vacation.