#cholekulche
1 messages · Page 1 of 1 (latest)
I tried to read iframe of stripe payment element to get these html items but since the iframe is served from third party domain I can’t read the iframe through js. Essentially we need this data to understand which payment methods are getting shown to our users in realtime
You can listen to ready event on the element
It should return availablePaymentMethods
https://stripe.com/docs/js/element/events/on_ready#element_on_ready-handler-availablePaymentMethods
In the document it says that it is supported only for express checkout form
But I am using payment element
ah good catch
are you creating PaymentIntent/SetupIntent prior to rendering elements?
Setup intent
but are you creating it prior to rendering elements or after?
Prior to rendering element through a client secret
Gotcha. So one option would be to look at payment_method_types on the SetupIntent to see what PaymentMethods are supported
it wouldn't show you any of the wallets though
Oh when I checked that it only returns card… even if I pay through any wallet. Currently we have enabled only card, gpay, Apple Pay on stripe dashboard
But I don’t think it would give realtime list of payment methods shown to user right
Like if I configured to show [card, klarna] on stripe dashboard but only card payment method was visible in real time to user. payment_method_types would still be [card, klarna] right
It shouldn't happen but not sure 100%.
Typically if klarna is not supported for a specific reason then it should just fail when you create the intent
The behaviour generally is that we can mention a set of payment methods to show to user. Now let’s say in realtime if some of the requirements were not met to show some payment methods. Stripe will just ignore them and show whatever payment methods it can show to user
For eg: gpay is only visible to user if they have setup their card in google account
Even though we mention stripe to show that payment method. It can omit based on user location and their card setup
I want these exact payment methods that were shown to user in realtime form
So let’s say if [a,b,c] payment methods were configured on stripe dashboard and only [a,b] were actually visible to user then I need [a,b] which can be a very important metric
Totally understand. I don't believe there's a good way to get that information with PaymentElement today unfortunately. I can flag a feature request for this
Okay no worries… yeah it would be very helpful if we can get this support in future because we can’t read or manipulate the iframe. So metrics related data, if they can be provided through some callback would be helpful to us
Yup, you can also flag this as feature request via our support form
https://support.stripe.com/?contact=true
That way you'd receive email/comms if there are any updates on this
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.