#heffoo_code

1 messages ยท Page 1 of 1 (latest)

wispy badgeBOT
#

๐Ÿ‘‹ 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.

proud pecan
#

๐Ÿ‘‹ happy to help

outer tapir
#

glad to see you here

proud pecan
#

this is how you create a PaymentMethod without Elements

outer tapir
#

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?

proud pecan
#

no

#

stripe
.createPaymentMethod({
type: 'sepa_debit',
sepa_debit: sepaDebitElement,
billing_details: {
name: 'Jenny Rosen',
},
})

outer tapir
#

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?

proud pecan
#

how are you collecting the Iban?

#

if you're collecting it using your own input

outer tapir
#

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'

proud pecan
#

this is an old Stripe Library

#

you shouldn't be using it

outer tapir
#

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'?

proud pecan
#

yes

outer tapir
#

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

proud pecan
#

on the contrary

outer tapir
#

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')

wispy badgeBOT
lost ibex
#

I'm not sur I'm following 100% here sorry

#

But in all cases you need to make sure that you are importing the needed package.