#heffoo_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1296384280372576368
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ happy to help
glad to see you here
at first, it doesnt work this way, because I received an error that 'Invalid PaymentMethod type passed to createPaymentMethod. Expected a string, got object.', so, I need to pass 'sepa_debit' as the first argument
at second, in the example we still need to use 'cardElement', isnt it?
no
stripe
.createPaymentMethod({
type: 'sepa_debit',
sepa_debit: sepaDebitElement,
billing_details: {
name: 'Jenny Rosen',
},
})
yes, and I am getting error ' Invalid PaymentMethod type passed to createPaymentMethod. Expected a string, got object.'
it works if I use it this way:
stripe
.createPaymentMethod('sepa_debit', {
sepa_debit: sepaDebitElement,
billing_details: {
name: 'Jenny Rosen',
},
})
but how can I get sepaDebitElement?
how are you collecting the Iban?
if you're collecting it using your own input
then you musst use https://docs.stripe.com/js#stripe_create_payment_method-paymentMethodData-sepa_debit[iban] instead
I'm using the IbanElement component:
<IbanElement
onChange={handleIbanChange} // I thought I could collect the IBAN number here, but 'value' is undefined every time
supportedCountries={['SEPA']}
/>
this IbanElement is imported from 'react-stripe-elements'
do you think I am getting error because the old version of the 'react-stripe-elements' not compatible with the 'stripe-js' and 'stripe-react-js'?
yes
does that mean it will work if I roll back my Stripe to the older versions?
if I remember right, Payment Methods isn't a new feature
on the contrary
I think you should remove react-stripe-element and migrate to the new integration with PaymentElement and if you don't want to confirm directly the Intent then you can use https://docs.stripe.com/payments/build-a-two-step-confirmation (with confirmationTokens instead of creating Payment Methods)
okay, but I will still need to get the sepaDebitElement, right? if I remove 'stripe-react-elements' and import everything from 'stripe-react', then IbanElement should automatically be included in stripe.elements() as long as it is wrapped in <Elements /> (which should also be imported from 'stripe-react-js')