#kevin_code
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/1432748608113082490
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there, currently juggling a few threads but I'll get back to you soon
Hey np take your time ๐
thanks for being patient. for your first question, are you seeing the saved payment methods focused when the Payment Element is first created? this is just about after elements.update occurs, right?
For the first question the saved payment methods is only appearing after elements.update occurs because I fetch this data with an API request to my back-end server
for your second question, I don't believe this is possible, everything that can be customized about the Payment Element is in the Appearance API https://docs.stripe.com/elements/appearance-api
For the first question, if my request response is fastest than initializing Payment Element, the "saved payment methods" tab is opened, otherwise it's "new credit card" that is opened
sorry, if it's fastest? faster than what? some other request you are making?
Okay thanks I saw that doc indeed, can we update the "Afficher plus" to add an underline for example?
I can't find this information in the documentation
Oh yes let me add some context, when I reach my screen with my cart
- I call my back-end server to fetch the customer session secret
- In the same time I render
<PaymentElement>from'@stripe/react-stripe-js'
If my back-end request response is fastest than the initialization of PaymentElement, my "saved" tab is opened first
Otherwise it's "new credit card" tab that is opened
Is it possible to add something like a listener or use a method to open "saved payment methods" tab when I update elements with customer client session secret?
gotcha, thanks for that context. Ideally you would await that call to retrieve the customer session secret before rendering the payment element. I don't believe there's a method to choose which payment method tab to focus, generally it's just the one that's specified first
Oh okay that's what I did previously but because of business issues, I need to re-fetch the endpoint again if the price is updated due to a promo code for example so I can't do this but anyway it's something I should discuss with my team
Last question is how can I style the "Afficher plus" text button? Is it possible? I can't find this information in the documentation