#pure_docs

1 messages ¡ Page 1 of 1 (latest)

ebon riverBOT
#

👋 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/1265839340060409982

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

lilac lance
#

Can I update it to always and never on the same session (based on user input)? How would I go about doing that?

jaunty stump
#

What do you mean by "always and never on the same session" ?

lilac lance
#

As in, say I don't want to display any payment options until the user fills out some input

#

and when that is properly filled out, then I want to show them the payment methods

#

so initially turned to 'never' but then turned to 'always'

jaunty stump
#

Then how about just hide the ExpressCheckoutElement, and only conditionally show it after your customer made their choice?

lilac lance
#

I need to know what payment methods are going to be available to the customer by listening to the ready event of Express Checkout element before I allow displaying it

jaunty stump
#

Just curious, why can't your customer choose the payment method on Express Checkout Element directly?

lilac lance
#

If the screen size is too small, we want to show Stripe payment elements on another tab. However, if no Stripe payment methods are available (since Apple Pay/Google Pay only work on certain devices) then I don't want to show the tab option to them.

#

But if it is available to them, the tab will be visible and then the Express Checkout element will be within that tab sheet

#

Is there a way I can get what payment methods are available to the customer without displaying them?

jaunty stump
#

So basically you want to know whether Google Pay and Apple Pay are available before mounting the ExpressCheckout Element?

lilac lance
#

Yeah

jaunty stump
lilac lance
#

It looks like that'd return false if the customer didn't have a apple pay card set up

jaunty stump
#

Yes you are right

lilac lance
#

On the previous qestion of just conditionally showing the express checkout element, will it result in an API call each time I hide and unhide?

#

Basically asking if it would mean there'd be a lag to show the payment methods when I unhide it

jaunty stump
#

Since options is a param for ExpressCheckoutElement creation, so I don't think you can update it after the ExpressCheckoutElement is mounted. The workaround will be creating a new ExpressCheckoutElement to replace the old one.

lilac lance
#

Is a workaround to determining available payment methods before displaying them hiding the element in the ready event of the express checkout element?