#theddev_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/1411051935066361980
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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?
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')
Thanks for sharing! Let me try to reproduce the issue on my end, so that I can advise the solution accordingly
sure thanks.
paymentMethodTypes: ['card'] works for me. You can't use paymentMethodTypes and excludedPaymentMethodTypes together. Could you try just using paymentMethodTypes: ['card'] ?
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?
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()
okay, so after the const elements = stripe.elements(options);
do i invoke
elements.create();
?
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
got it sir/maam trying on my end
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?
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
okay, thank you soo much sir/maam it worked. ๐