#brandon_17715
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- brandon-3ds, 4 minutes ago, 27 messages
- brandon-pm-clone, 1 day ago, 15 messages
- brandon_17715, 1 day ago, 26 messages
Hello! Is this for the Payment Element?
Yeah, that's the Payment Element.
but I want it to default to just these fields if I pass in a prop that's something like, showCConly
or this, with showACHonly
whoops one of those is wrong hold on
You can set paymentMethodOrder when you create the Payment Element: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-paymentMethodOrder
so I'm doing something like this
mode: 'payment',
amount: amount,
currency: brand.currency?.code?.toLowerCase() || 'usd',
appearance: {},
paymentMethodCreation: 'manual',
paymentMethodOrder: ['us_bank_account'],
};
<Elements stripe={stripePromise} options={stripeOptions}>
<ChildComponent />
</Element>
but both CC and ACH are still showing up
Yeah, they'll both show up, but the one you specify first should be the one displayed first.
You wanted to change the default, right?
Not quite, because we allow our users to turn off ACH (or CC) on our platform, we want to completely hide those options when their clients pay the invoices
so, if the user only has CC toggled on in our platform, when their client goes to pay an invoice, it should only show this image, with no option to toggle between CC or ACH
In that case you need to specify the paymentMethodTypes when you create the Elements instance and only specify the ones you want to use.
is this possible if I'm using the react hooks? specifically the useElements() one? I didn't see any option to pass in props in the interface
I'm not a React developer, but it should be possible, yeah.
It goes alongside your mode: 'payment', options and whatnot.
Ah you're right, I found the docs for them