#kevin_code

1 messages ยท Page 1 of 1 (latest)

neat cedarBOT
#

๐Ÿ‘‹ 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.

young tree
#

hi there, currently juggling a few threads but I'll get back to you soon

daring lion
#

Hey np take your time ๐Ÿ™‚

young tree
#

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?

daring lion
#

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

young tree
daring lion
#

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

young tree
#

sorry, if it's fastest? faster than what? some other request you are making?

daring lion
#

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?

young tree
#

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

daring lion
#

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

neat cedarBOT
steady valve
#

๐Ÿ‘‹ Taking over this thread, catching up now

#

I'm afraid the text such as Afficher plus in the Payment Element can't be customized

#

The Appearance API only supports the general customisation of the Payment Element, but not to a specific field