#maxim-k_payment-element-usbank

1 messages ¡ Page 1 of 1 (latest)

karmic coveBOT
#

👋 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/1327034811159937056

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

upper mortar
#

Hi

#

I'm working on Source/Charge transition to PaymentElement and need to replace custom bank account form with form element. I don't need tabs or accordion with various payment methods, but wonder what is the simple way to call payment element form for us bank account only?

tacit pumice
#

What kind of element are you trying to create?

upper mortar
#

I need Us bank account

tacit pumice
#

Okay, yes in that case you would want to use the Payment Element but specify that the only Payment Method type that is valid is us_bank_account

upper mortar
#

Here is the list of valid ones: card, cardNumber, cardExpiry, cardCvc, postalCode, paymentRequestButton, iban, idealBank, p24Bank, auBankAccount, fpxBank, affirmMessage, afterpayClearpayMessage, paymentMethodMessaging, linkAuthentication, payment, address, expressCheckout

#

How i can do it?

tacit pumice
#

When you create your Element, do you already have a Payment Intent or Setup Intent? Or do you create those after?

upper mortar
#

After

tacit pumice
#

Okay perfect.

upper mortar
#

const options = {
mode: 'payment',
amount: 1099,
currency: 'usd',
// Fully customizable with appearance API.
appearance: {/.../},
};

#

Here the options

#

How i can "tell" to use only one?

#

const paymentElementOptions = { layout: 'accordion'};

tacit pumice
upper mortar
#

Which one is related to us bank account?

#

I don;t see valid values in doc

#

paymentMethodTypes
array

#

but where is array values can be used?

tacit pumice
upper mortar
#

i see, thanks!

#

Have a good day!

tacit pumice
#

But for your use-case, you should quickly test ['us_bank_account']

upper mortar
#

how?

#

in options?

tacit pumice
#

The doc I linked earlier, where I mentioned this parameter, shows you where to add this value

upper mortar
#

options["paymentMethodTypes"]=['us_bank_account']

#

?

#

ok!

tacit pumice
#

var elements = stripe.elements({
  mode: 'payment',
  currency: 'usd',
  amount: 1099,
  paymentMethodTypes: ['us_bank_account']
});
var element = elements.create('payment')
upper mortar
#

Thanks!

upper mortar
#

Sorry

#

Are you still there

#

?

tacit pumice
#

Yes, what's up?

upper mortar
#

So, here is an issue. In my setup i need payment element used only to capture and save payment method (bank account), But it seems amount is required if mode="payment"

tacit pumice
#

Okay, so use mode: 'setup'

#

All of this is covered in our documentation. I recommend you thoroughly review it

upper mortar
#

mode
Conditionally required
'payment' | 'setup' | 'subscription'

#

there is no any description for values

#

like in other API docs

#

Thank you for your help!

tacit pumice