#sarita_21302
1 messages · Page 1 of 1 (latest)
Is it possible to display only payment screen and not the product screen on the left?
No that's not possible
ok. I want to display above 'card information' style card fields on the form created using payment-elements. How can I acheive it? Can I hide the labels, if not, is there any other ways to customize it?
You can't customize the text within Payment Element. The customization that you can do is what you see with the Appearance API: https://stripe.com/docs/elements/appearance-api?platform=web
I changed the labels to b floating but it doesn't seem to be working
const paymentElementOptions = {
layout: "tabs",
labels: "floating",
};
const paymentElement = elements.create("payment", paymentElementOptions);
paymentElement.mount("#payment-element");
What does "it doesn't seem to be working" mean?
The labels are not floating, it's always there. is there a sample page that I can refer to see how it looks
You need to pass an appearance object to paymentElementOptions
ok
const appearance = {
rules: {
'.Tab': {
border: '1px solid #E0E6EB',
boxShadow: '0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(18, 42, 66, 0.02)',
},
'.Tab:hover': {
color: 'var(--colorText)',
},
'.Tab--selected': {
borderColor: '#E0E6EB',
boxShadow: '0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(18, 42, 66, 0.02), 0 0 0 2px var(--colorPrimary)',
},
'.Input--invalid': {
boxShadow: '0 1px 1px 0 rgba(0, 0, 0, 0.07), 0 0 0 2px var(--colorDanger)',
},
// See all supported class names and selector syntax below
}
};
// Pass the appearance object to the Elements instance
const elements = stripe.elements({clientSecret, appearance});