#yingzhu_
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Can you clarify what you mean when you say you "used paymentMethodTypes but it's not working"?
I pass ['card'] as paymentMethodTypes in to Element on FE, but I still see other payment method like link in the paymentElement UI
Okay so you still see Link but is that it?
Yes, I want to hide link in paymentElement but still have it enabled in the dashboard
Okay let me see what I can find out
Thanks, appreciate it!
Can I get the exact JavaScript you are using to create the Payment Element?
Element
const options = {
mode: 'subscription',
currency: currencyCode,
amount,
paymentMethodTypes: ['card'],
setupFutureUsage: 'off_session',
loader: 'never',
} as StripeElementsOptionsMode;
<Elements stripe={stripePromise} options={options}>
PaymentElement
const options = {
paymentMethodOrder: ['card', 'google_pay', 'apple_pay'],
};
<PaymentElement
options={options}>
Okay I'm a little confused. Both my colleague and I created and mounted Payment Elements with just [card] specified and neither of us see Link. And I definitely have Link enabled
Wait
You need to specify it in the PaymentElement Options, not the Elements objects
Oooh, like in wallet?
No
The options parameter passed to the PaymentElement includes the paymentMethodTypes param
not sure I got it, I only see paymentMethodOrder here(https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options)
Would you mind share a code snippet?
Sorry I got my own integration test mixed up.
const options = {
mode: 'payment',
amount: 1000,
currency: 'usd',
// paymentMethodTypes: ['card'],
paymentMethodTypes: ['card', 'link'],
};
const elements = stripe.elements(options);
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
Here is a colleague's code snippet. WHen they switch which paymentMethodTypes they user, Link appears/disappears from the Payment Element
Hmm, that's really weird, I have same in options but always get link
we have our default API version in dashboard as 2023-10-16 could that be related? I know that's the version default to auto payment method
That version includes auto payment methods as default on multiple APIs but is overwritten if you supply it.
I adjusted my elements options in the same way and it hides link for me. If I exclude it I see link along with 6 additional Payment Methods
Do you have a publicly accessible front-end I could inspect?
One different between the code you shared and mine is I am using react js library, could that cause the issue?
The Reactjs library is really just convenience wrappers around the Stripe.js methods to make them more React-y
But you could try it out with vanilla JS to see if you get a different result
In that case we would need to double check how the stripe-react.js library is passing the parameters back
Okay, lemme try vanilla JS
I tried vanilla JS and still get link
Okay, so at least something isn't broken with stripe-react ๐
Do you have a front-end I could examine?
Not yet, unfortunately ๐
Another interesting things I noticed is after comment out "paymentMethodTypes", I did not get all payment methods(I also have Bancontact enabled in dashboard and the currency is eur)
Could this be an setting issue on my account?
Hi there. At this point, I think you'll need to write into our support team with your full code that you are using in your React front-end for help on this. We'll likely need to examine all of that and your account configuration to find the issue. This isn't something that we'd be able to do on Discord here, since we help many users simultaneously.
Got it, make sense. would you mind share the contact of support team?
Sure
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Recommend emailing in with as much detail as possible, providing your code