#Julio
1 messages · Page 1 of 1 (latest)
There is only the Appearance API for styling elements: https://stripe.com/docs/elements/appearance-api
You can try passing the appearance variable as the example
I only find lineHeight and fontLineHeight for inputs
ah yes sorry, but what about borderRadius ?
I also see it on above Doc!
hi again
Hey!
where can i find how to customize borderRadius using this one
there is nothing in the type def
There's no IBAN Element referenced there?
fuck i link u the wrong url
you need to work on this, i used a scenario that i cant find
ok ok
for sure
(but it took me 10 min , its painful )
in the IBAN_STYLE constant
where do i put borderRadius
Uses the Style API, not Appearance API: https://stripe.com/docs/js/appendix/style
Not sure if that property is supported
Why not just use the Payment Element?
I'd just ignore those docs and use the Payment Element instead
seriously ? 😦
as in "dont use import {IbanElement} from '@stripe/react-stripe-js';"
Well, up to you. But the Appearance API is way more flexible than the style object
And only the Payment Element supports the Appearance API
so i dont use these :https://stripe.com/docs/stripe-js/react#fournisseur-elements
how do i create an Element in react then ?
No, that's still valid. It literally references the Payment Element
What exactly are you trying to do?
i'm trying make a form so user can save an SEPA IBAN
but i'd like my form to look the same as the rest.
i'm using mui style
I don't know what 'mui style' is
I'd recommend using the Payment Element: https://stripe.com/docs/payments/payment-element
That supports the flow you're describing, and is customisable: https://stripe.com/docs/payments/customize-payment-element
The old, PM specific Elements are generally out of favour
fyi
I'd imagine you'll have an easier time adapting the Payment Element to fit that style than you would the older Elements
i'm sorry all those methods are bit confusing
const paymentElement = elements.create('payment', { layout: { type: 'accordion', defaultCollapsed: false, radios: true, spacedAccordionItems: false } });
where is elements coming from ?
What do you mean?
i what do you mean what do you mean
i'm trying to use the docs, but its either using useStripe useElements, or pure JS, type definition won't work
You need to provide me with a specific issue/error. We're jumping all over the place here
Everything from Stripe.js should be typed, so you'll need to be more specific
If you want to use the IBAN Element (https://stripe.com/docs/js/elements_object/create_element?type=iban), then you'll need to pass the style param when creating the instance: https://stripe.com/docs/js/appendix/style
Otherwise, you use the appearance parameter with the Payment Element: https://stripe.com/docs/js/elements_object/create#stripe_elements-options-appearance
ok
specific
the elements in your doc
it comes from here var elements = stripe.elements({
clientSecret: 'CLIENT_SECRET',
});
BUT
i'm in react app
so its not the same
how do i get it
useElements()
https://stripe.com/docs/stripe-js/react#useelements-hook
ok
and how should i display such Element in JSX ?
let IbanElementCustom;
if (stripe !== null && elements !== null) {
IbanElementCustom = elements.create("iban", stripeIbanElementOptions);
}
<IbanElement /> I think
does not work
No, that's an internal API. We export a <IbanElement /> component
You say 'it doesn't work' – can you be more specific?
but this IbanElement is not customizable
what specific customisations do you need?
hi senior manager
i need to add some borderRadius
while using IbanElement : https://stripe.com/docs/payments/sepa-debit/set-up-payment
don't call me that, be respectful. I'm nobody's manager.
ur colleague here advise my to NOT use react method, using directly stripe-js
you can pass <IbanElement style={styleObject} />
in order to customize better
where that is an instance of https://stripe.com/docs/js/appendix/style?type=iban
looks like we don't support a borderRadius property
hum
ok
so its not doable is what you mean
and i can't create a ReactComponent from a element created using stripe-js lib ?
doesn't seem like it! the way you style things in stripe.js is passing JS objects like that one(because the inputs are iframes of a secure Stripe site, so they can't use CSS on your own page). So you can only use things that our style API has implemented.
You can try applying your style to the component mounting the Element like <div style="....."><IbanElement /></div>, sometimes that accomplishes what you want
why would you want to? the react-stripe-js library already does that
it seems that borderRadius is supported by style property in stripe-js , thats why
do you have a link to where you see that?
well ok its not supported
indeed! the things that the IbanElements supports is what I linked to. Maybe you were looking at the style options for PaymentElement, which is a different thing
i thought ur colleegue said it was
my bad
at this point mate
i dont know what i'm looking at
whats the difference between paymentELement style options and ibanElements ?
they're different, not sure how I can answer that
they're different components, PaymentElement is a drop in form with multiple fields and tabs and inputs, IbanElement is just a single input for a bank account number. The PaymentElement uses a specific API for styles(https://stripe.com/docs/elements/appearance-api) built for it; separate elements like IbanElement are older/pre-date when we created PaymentElement, and use a simpler system
but can use Iban with this method ?
which method, the PaymentElement?
the PaymentElement supports SEPA Debit payments(part of which is accepting an IBAN), yes
but only for payment? i can't save a sepa debit ?
you can, https://stripe.com/docs/payments/sepa-debit/set-up-payment as shared earlier
should just work with the PaymentElement being passed a SetupIntent as well, that specific doc only talks about the IbanElement but PaymentElement should work too