#kaustuva-le

1 messages · Page 1 of 1 (latest)

wanton kettleBOT
digital ingot
#

Hi there, PaymentIntent's payment_method_types would tell you want payment methods are avaible for this payment.

crimson mulch
#

I would like to have the information just before I reach my checkout to additionally show/not show certain elements based on which payment methods are available. I guess the payment intent wouldn't have been created at this point of time?

digital ingot
wanton kettleBOT
crimson mulch
#

How does the payment element know which methods to show?

#

if we render first and create payment intent later

glass kiln
#

At Step 3 of above deferred intent doc, Payment Element will be able to determine the payment methods based on the amount, currency and mode set in the options of elements config. More specifically, this block of codes:

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

// Set up Stripe.js and Elements to use in checkout form
const elements = stripe.elements(options);
crimson mulch
#

How does it know which methods to show for the currency?
e.g. for USD, I could have two connect accounts which receive USD, one for hotels and one for flights.
Afterpay could be enabled on the connect account for hotels but not flights. How would the payment element know in this case?

glass kiln
#

Which type of connected account do you use? Standard, Express or Custom?

crimson mulch
#

Standard

glass kiln
crimson mulch
#

What's the API function to get the payment methods from the stripeAccount object?

glass kiln
#

Can you share what you would like to achieve? What is the purpose of getting payment methods?

crimson mulch
#

We want to consider a solution where we have our own accordions with a payment method.
Once the user selects it, it displays a payment element with that one method only.

But for this we need to know what payment methods are available so we do not show an accordion which is blank inside.