#maxim-k_payment-element-usbank
1 messages ¡ Page 1 of 1 (latest)
đ 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.
- maxim-k_api, 16 hours ago, 34 messages
- maxim-k_api, 1 day ago, 62 messages
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?
What kind of element are you trying to create?
I need Us bank account
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
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?
When you create your Element, do you already have a Payment Intent or Setup Intent? Or do you create those after?
After
Okay perfect.
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'};
In that case, you would specify the paymentMethodTypes when you create your stripe.elements
https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodTypes
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?
You can use all the values shown here: https://docs.stripe.com/api/payment_methods/object#payment_method_object-type
But for your use-case, you should quickly test ['us_bank_account']
The doc I linked earlier, where I mentioned this parameter, shows you where to add this value
var elements = stripe.elements({
mode: 'payment',
currency: 'usd',
amount: 1099,
paymentMethodTypes: ['us_bank_account']
});
var element = elements.create('payment')
Thanks!
Yes, what's up?
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"
Okay, so use mode: 'setup'
All of this is covered in our documentation. I recommend you thoroughly review it
mode
Conditionally required
'payment' | 'setup' | 'subscription'
there is no any description for values
like in other API docs
Thank you for your help!
I recommend reviewing this doc: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=setup