#dzmitry_api

1 messages ¡ Page 1 of 1 (latest)

orchid geyserBOT
#

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

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

shrewd haven
opaque panther
#

No, it's not true. I'm using pre-build Stripe Element
But...
I have custom checkout form with a lot of different payment methods. Stripe is the one of many.

Currently user sees stripe Element after he clicked by my custom button, which renders stripe Element and so on

I want to show two my stripe buttons on the my checkout form: Stripe Card, Stripe APM. So, I need to know list of all available apyment methods before I rendered stripe Element. I need to know it because if there are no any APM enabled I do not want to show Stripe APM button

shrewd haven
#

I see, thanks for the info! if your goal was to identify the supported payment methods before creating a PaymentIntent, we'd typically recommend to use the Deferred Intent Creation flow (i.e. rendering the Element before creating an Intent): https://docs.stripe.com/payments/accept-a-payment-deferred

#

but since you want to do this before rendering the Element, that approach wouldn't work here, so I'm checking for an alternative

#

I'm afraid this isn't possible

Stripe identifies which payment method types to display when the Payment Element is rendered, not before that point

when the Payment Element is initialised and rendered on the page, that's when Stripe dynamically determines which payment methods to show

#

there is no client-side API or method you can call which returns a list of the available payment method types - this is computed on our side when the Element itself is rendered

opaque panther
#

it can be server side API. is there BE API endpoint which returns this info?

Also I see that stripe Element sends request like this: https://api.stripe.com/v1/elements/sessions?deferred_intent[mode]=payment&deferred_intent[amount]=359&deferred_intent[currency]=pln&currency=pln&key=pk_test_...&_stripe_account=acct_...&elements_init_source=stripe.elements&type=deferred_intent
and result looks like what I need. but this request is not ocummented, so, I think it's something for internal usage. right ?

shrewd haven
#

taking a closer look into this request!

#

thanks for your patience

you're correct that this is an internal endpoint (the front-end calls this when the Element is loaded), and I'm afraid it's not possible to call this endpoint by itself from either the front-end or the server

opaque panther
#

it works from the my console. I just sent it with curl. ok. thank you very much. I'll try to find workaround

#

have a good day