#chung-yi_best-practices
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/1341443781819633744
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
No unfortunately there's not a hook for the payment element
Do you create a payment intent up-front?
No, we are planning to do deferred intent approach.
Would it be possible to get the available dynamic payment methods through an intent?
Yeah the payment intent will have payment_method_types with the available payment method types
However that list could be slightly different from what's seen by the customer
Since there's some payment method types that are restricted by IP, browser location, etc
OK so that's still not perfect I assume. ๐ค
What would you recommend in this case, if we want to tailor our page based the available payement methods from the Payment Element UI?
Yeah there's not really a good solution at the moment
What specifically do you need to update?
We want to show certain payment method specific information, outside of the payment element iframe, but only the ones the's available and displayed in the payment element.
One thing you can consider doing is only displaying the selected payment method's info
There's an onChange event you can listen to which will give you the selected payment method type: https://docs.stripe.com/js/element/events/on_change?type=paymentElement#element_on_change-handler-value
Yeah, will need to discuss with design and see if we can address it from the UX perspective.
Would you be able to request this feature internally? It seems expanding this availablePaymentMethods to Payment Element would be very helpful! https://docs.stripe.com/js/element/events/on_ready#element_on_ready-handler-availablePaymentMethods
Yes I'll submit a feature request for that
Awesome! Thank you so much for the help!! ๐
No problem