#yingzhu_

1 messages ยท Page 1 of 1 (latest)

frozen jungleBOT
stoic forum
#

Hi ๐Ÿ‘‹

Can you clarify what you mean when you say you "used paymentMethodTypes but it's not working"?

lusty seal
#

I pass ['card'] as paymentMethodTypes in to Element on FE, but I still see other payment method like link in the paymentElement UI

stoic forum
#

Okay so you still see Link but is that it?

lusty seal
#

Yes, I want to hide link in paymentElement but still have it enabled in the dashboard

stoic forum
#

Okay let me see what I can find out

lusty seal
#

Thanks, appreciate it!

stoic forum
#

Can I get the exact JavaScript you are using to create the Payment Element?

lusty seal
#

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}>
stoic forum
#

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

lusty seal
#

Oooh, like in wallet?

stoic forum
#

No

#

The options parameter passed to the PaymentElement includes the paymentMethodTypes param

lusty seal
#

Would you mind share a code snippet?

stoic forum
#

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

lusty seal
#

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

stoic forum
#

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?

lusty seal
#

One different between the code you shared and mine is I am using react js library, could that cause the issue?

stoic forum
#

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

lusty seal
#

Okay, lemme try vanilla JS

lusty seal
#

I tried vanilla JS and still get link

stoic forum
#

Okay, so at least something isn't broken with stripe-react ๐Ÿ˜…

#

Do you have a front-end I could examine?

frozen jungleBOT
lusty seal
#

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?

raven fog
#

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.

lusty seal
#

Got it, make sense. would you mind share the contact of support team?

raven fog
#

Sure

#
#

Recommend emailing in with as much detail as possible, providing your code

lusty seal
#

Okay, I will email then

#

Thank you