#unibit
1 messages · Page 1 of 1 (latest)
hello! can you explain more on what issues you're facing?
am using stripe elements in asp.net webform, everything is working apart from layout, i did exactly what stripe says about applying themes but none is working, can you assist?
can you share your code?
var stripe = Stripe("<%= stripePublishableKey %>");
var clientsecret = "<%= ClientSecret %>";
var client_name = getParameterByName('cname');
var client_mail = getParameterByName('email');
var price = getParameterByName('price');
const appearance = {
theme: 'stripe'
};
var elements = stripe.elements(clientsecret, appearance);
var CardElement = elements.create('card');
CardElement.mount('#card-element');
The Appearance API doesn't apply to the Card Element. You need to use the style object: https://stripe.com/docs/js/appendix/style
this does not work either, it mess up everything!!
do you provide a premade style or custom css?
'does not work' how exactly?
Not with the older Elements, no. Only Payment Element
that means i need to style every element in form?
Yes, you'd need to use the style object to style each Element
how will i find all elements in your form?
I don't understand why you'd need to do that. You just pass the style param when you initialise the Element:
elements.create('card', {
style: {...}
})
is there any reference to your form objects?
You can just create a global style object that you can pass to each Element on creation
https://stripe.com/docs/js/appendix/style has all the supported properties
you dont have any premade style i could use ?
I already answered this