#pure_elements-ece-stripejs
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/1234523306837938366
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
Hello
You would not use that with Payment Request Button, no.
You would use confirmCardPayment() with Payment Request Button
Really, this is our legacy integration
Express Checkout Element is our newer, and recommended, integration here for a wallet Element.
Gotcha, the only reason why I was looking at it is because I want to possibly have my payment buttons in different locations. Such as Apple Pay on one tab and Google Pay on a different tab of my checkout page and it seems the express checkout element always just bundles these buttons together.
Ah, well you can render multiple Express Checkout Elements if you render multiple instances of Stripe.JS. This also doesn't work with Payment Request Button as that will always just show a single button based on the browser (see: https://docs.stripe.com/stripe-js/elements/payment-request-button?client=html which indicates which button will be shown for Payment Request Button)
So really you should use Express Checkout Element here if you want to accomplish what you are looking for
How would I hide certain buttons from each of the multiple express checkout elements?
Say I only want Apple Pay shown on the first and only Google Pay shown on the second?
Oh, thanks! It is only possible to do with Apple and Google pay? So, hiding something like Amazon Pay wouldn't work?
You can control that via paymentMethodTypes: https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#additional-options
Since Amazon Pay is a different Payment Method Type than card, which applies to both Google Pay and Apple Pay
Hmm, I'm trying to test by sending in an empty array so it just ends up rendering Apple Pay, but it seems when you do that, it will just end up rendering all the available payment method types still.
Yeah you would specify card in that case
An empty array defaults to your Dashboard-set Payment Methods
That worked, thanks!
๐
Unrelated question, but was wondering if you knew more: Do you know why there's a delay in showing payment methods upon a page load? I figured it was because of the loadStripe call that was happening client-side, but I moved that to server-side render along with my other dependencies on the page and it still seems to take a second or two before payment methods show up. Is that just a limitation of Stripe?
Yeah there is some latency involved with the Stripe.JS calls to mount Express Checkout Element
You would see the same thing at https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#additional-options at the top of the page
Sounds good, thanks for all your help! ๐