How do I determine if my user's device supports Apple Pay on my web app?

776 views
Skip to first unread message

packet...@gmail.com

unread,
Oct 23, 2018, 11:03:58 AM10/23/18
to Stripe API Discussion
I've seen documentation here on how to verify the user device supports Apple Pay, but it only applies to iOS. I need to check this on a web app. Thanks in advance.

Remi J.

unread,
Oct 23, 2018, 11:06:18 AM10/23/18
to api-d...@lists.stripe.com
Hello,

To accept Apple Pay on the Web, you would use the Payment Request button and you can find its documentation here: https://stripe.com/docs/stripe-js/elements/payment-request-button 

This lets you accept Apple Pay on your website along with other payment methods such as Google Pay or Microsoft Pay. You don't need to anything specific to detect if someone supports Apple Pay or not as the button will do that for you and only appear if they do.

Hope this helps!
Remi

On Tue, Oct 23, 2018 at 8:03 AM <packet...@gmail.com> wrote:
I've seen documentation here on how to verify the user device supports Apple Pay, but it only applies to iOS. I need to check this on a web app. Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Seth Delbridge

unread,
Oct 23, 2018, 11:14:53 AM10/23/18
to api-d...@lists.stripe.com
Hey Remi, thanks for the help. In my case, there are some UI-dependent parts of my app that change based on Apple Pay availability. Is there any way to know about Apple Pay support specifically for the current device?

Remi J.

unread,
Oct 23, 2018, 11:16:53 AM10/23/18
to api-d...@lists.stripe.com
Hey Seth,

You can use the `canMakePayment()` method that will let you know if Apple Pay is supported on their device and it's documented here: https://stripe.com/docs/stripe-js/reference#payment-request-can-make-payment It has some limitations on which browser supports the feature but it should suit your needs.

Best,
Remi

packet...@gmail.com

unread,
Oct 23, 2018, 11:35:28 AM10/23/18
to Stripe API Discussion
Cool! I'll try that. Thanks again
Reply all
Reply to author
Forward
0 new messages