#cashiersprit - Wallet Payments
1 messages · Page 1 of 1 (latest)
I understand. but if user does not setup google pay or apple pay before, then it won't show to user right
also, if user is not using safari, then apple pay won't show either
is there a way we can tell, the wallet pay is actually showing in user's browser
You're correct about Apple Pay and Google Pay not showing up if the customer hasn't set them up, and you're correct that Apple Pay is only supported in Safari. I don't believe the Payment Element indicates what's being displayed as an option. Can you tell me more about your use case?
our user case is just want to statistics whether wallet pay is available to user and how many percent of user use wallet pay if they are available
so we need to know whether wallet pay is currently showing in user's browser or not
There are properties on the Payment Method that show you if the Payment Method was created with Apple Pay or Google Pay: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-wallet-apple_pay
yes, but user could use card payment when wallet pay is showing to them. we want to know whether wallet pay is showing to user, but payment method is created after user make actual payment. it looks not straight to me
whether user make payment by card or wallet pay is one thing. whether wallet pay is showing to user's browser is a diff thing.
Let me test something, hang on...
Okay, so what you can do is listen for the change event on the Payment Element: https://stripe.com/docs/js/element/events/on_change?type=paymentElement
In the event the value will show what's currently selected, including Apple Pay and Google Pay.
Yeah, if you want to know if it's displayed as an option but never selected that's not something you can do with the Payment Element.
You would need to disable Apple Pay and Google Pay in the Payment Element and use the Payment Request Button instead.
With the Payment Request button you can use this API to determine what's supported: https://stripe.com/docs/js/payment_request/can_make_payment
You can disable wallets in the Payment Element: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-wallets
And then add the Payment Request Button alongside the Payment Element: https://stripe.com/docs/stripe-js/elements/payment-request-button
ok, it looks there is no way to do it in payment element
Correct, as far as I know it's not possible with just the Payment Element.
thanks for your answer. it saves me a lot of time to dive your tech docu 🙂