#brandon_17715

1 messages · Page 1 of 1 (latest)

regal crowBOT
#

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.

spark apex
#

Hello! Is this for the Payment Element?

wooden vine
#

this is what we currently have on the FE

#

yep! for payment element

spark apex
#

Yeah, that's the Payment Element.

wooden vine
#

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

spark apex
wooden vine
#

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

spark apex
#

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?

wooden vine
#

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

spark apex
#

In that case you need to specify the paymentMethodTypes when you create the Elements instance and only specify the ones you want to use.

wooden vine
#

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

spark apex
#

I'm not a React developer, but it should be possible, yeah.

#

It goes alongside your mode: 'payment', options and whatnot.

wooden vine
#

Ah you're right, I found the docs for them