PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, November 11, 2022

[FIXED] How to check Apple compatible devices

 November 11, 2022     applepay, javascript, payment-gateway     No comments   

Issue

I have a payment method Apple Pay it is restricted to only Apple Compatible devices. I need to show the Apple Pay Button if only the Apple Compatible devices.

How do I check Apple Compatible devices like Iphone,Ipad,Apple Watch and Mac in checkout html page using javascript?


Solution

You need to check the Applepay is available using the below code. Link to details here

if (window.ApplePaySession) {
   var merchantIdentifier = 'example.com.store';
   var promise = ApplePaySession.canMakePaymentsWithActiveCard(merchantIdentifier);
   promise.then(function (canMakePayments) {
      if (canMakePayments)
         // Display Apple Pay button here.
}); }


Answered By - B L Praveen
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing