#theddev_code

1 messages ยท Page 1 of 1 (latest)

wild nicheBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

proper copper
#

Tried paymentMethodTypes, excluded_payment_method_types, excludedPaymentMethodTypes (wasn't sure if camelcase is correct or snakecase so used both) but didnt work.
What didn't work specifically? Do you mean the payment method types are not excluded, or not customised properly? If so, could you share the example code that is not working as expected?

upbeat monolith
#

yes, I could still see the US bank account

#

let options = {
paymentMethodTypes: ['card'],
excluded_payment_method_types: ['us_bank_account'],
excludedPaymentMethodTypes: ['us_bank_account'],
fields: {
billingDetails: {
email: 'never',
address: {
postalCode: 'never',
country: 'never',
},
},
},
} as StripePaymentElementOptions;
this.paymentElement = this.stripeStore.elements.create('payment', options);

        this.paymentElement?.mount('#payment-element')
proper copper
#

Thanks for sharing! Let me try to reproduce the issue on my end, so that I can advise the solution accordingly

upbeat monolith
#

sure thanks.

proper copper
#

paymentMethodTypes: ['card'] works for me. You can't use paymentMethodTypes and excludedPaymentMethodTypes together. Could you try just using paymentMethodTypes: ['card'] ?

upbeat monolith
#

sure let me try

#

I simplified it to elements.create('payment', {paymentMethodTypes: ['card']});
and still could see us bank account

#

can you share your code?

proper copper
#
options = {
  mode: 'payment',
  paymentMethodTypes: ['card'],
  currency: 'usd',
  amount: 1099,
}

This is then used in:

const elements = stripe.elements(options);
#

Ah

#

I know where the problem is. The options should be set at stripe.elements(), not stripe.elements.create()

upbeat monolith
#

okay, so after the const elements = stripe.elements(options);
do i invoke
elements.create();

?

proper copper
#

Yes, you should! stripe.elements create the Elements group, whereas stripe.elements.create('payment') creates a Payment Element. Elements is the parent configuration for all Stripe Elements. The payment method config should be set Elements group level

upbeat monolith
#

got it sir/maam trying on my end

wild nicheBOT
upbeat monolith
#

I think this will take time on my end, we can close this and If It doesnt work I will reopen. Will that be okay?

broken palm
#

I can leave it open for a bit, but if this is closed by the time you get back you can start a new conversation

upbeat monolith
#

okay, thank you soo much sir/maam it worked. ๐Ÿ™‚