#dzmitry_api
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/1420373951942754394
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hey there! can you share more about the custom buttons you're rendering? it sounds like you're not using pre-built Element components[0], is that correct?
[0] https://docs.stripe.com/sdks/stripejs-react?ui=embedded-components#available-element-components
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
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
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¤cy=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 ?