#ara
1 messages · Page 1 of 1 (latest)
Hi 👋
So you want to only display the Payment Element if the Express Checkout Element does not present any valid wallets? Or do something else based on whether or not the Express Checkout Element is presented?
Hey! No I just want to render the divider and pay another way ONLY if the apple pay is rendered. https://checkout.stripe.dev/preview
Preview some of the features available in our prebuilt, hosted payment page.
In the preview where they have 'Or pay another way'
Just want to render that if express checkout is actually showing any payment options
Okay I get what you mean
https://stripe.com/docs/js/payment_request/can_make_payment
I saw this but I would have to create a payment request object with a payment item object...
Yeah i was just looking to see if we have an analog of that functionality
That would be the ideal solution
Right
Another option I considered is getting the express checkout element from the dom
const expressCheckoutElement = elements.getElement('expressCheckout');
But not sure if there are any fields I can check there
That is what I was thinking. I'm checking my test integration but I'm not seeing any data in that element object to indicate what wallets are presented
I inspect elemented the preview page but its literally called fakewalletbutton and the or pay another way ui doesnt render conditionally 🥲
Okay a colleague of mine helped point this out. We have a ready event that provides this information. You just need to listen for it.
https://stripe.com/docs/js/element/events/on_ready
The field you are looking for in the event is availablePaymentMethods
Wowwww
Tysm
❤️
Can I ask one more thing
When testing stripe locally, the ui doesnt render for me. It renders fine on my staging static website though. I believe this is because on my staging website I have ssl certificate whereas locally I do not. Locally my app is on https with no ssl certificate. Do I have to be on http locally for the ui to show up?
You need to be using HTTPS for the wallets to render. I would recommend looking into tools like ngrok https://ngrok.com/ if you need to test locally
Gotcha. Thank you