#pure_docs
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/1265839340060409982
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Yes you can hide the paymentMethod by setting it to "never" https://docs.stripe.com/js/elements_object/create_express_checkout_element#express_checkout_element_create-options-paymentMethods
Can I update it to always and never on the same session (based on user input)? How would I go about doing that?
What do you mean by "always and never on the same session" ?
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'
Then how about just hide the ExpressCheckoutElement, and only conditionally show it after your customer made their choice?
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
Just curious, why can't your customer choose the payment method on Express Checkout Element directly?
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?
So basically you want to know whether Google Pay and Apple Pay are available before mounting the ExpressCheckout Element?
Yeah
https://docs.stripe.com/js/payment_request/can_make_payment This API will tell you whether Google Pay or Apple Pay is available to your customer.
It looks like that'd return false if the customer didn't have a apple pay card set up
Yes you are right
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
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.
Is a workaround to determining available payment methods before displaying them hiding the element in the ready event of the express checkout element?