How to verify ios device supports Apple Pay

前端 未结 2 2021
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-20 11:40

I\'m starting an Apple Pay integration project and have been able to wire up a transaction on the device, and use Stripe to authorize the payment. The part I\'m actually st

相关标签:
2条回答
  • 2020-12-20 12:18

    canMakePayments - Will return "YES" ( True / 1 ) irrespective of card configuration.

    canMakePaymentsUsingNetworks - Will return "NO" , if card NOT configured or NOT configured properly.

    So,should check both... If both should be TRUE then only need to make Button "Apple Pay" visible.

    Hope this helps.

    0 讨论(0)
  • 2020-12-20 12:36

    In swift 3.0 you can check your device support apple pay or not via this funcation is its return true then your device support apple pay. Here are the list of device that support apple pay :

    iPhone 5s only if you purchase latest peace

    iPhone SE,

    iPhone 6 or later,

    iPad Pro,

    iPad 5th generation,

    iPad Air 2,

    iPad mini 3 or later,

    and Apple Watch.

    func applePaySupported() -> Bool {
                return PKPaymentAuthorizationViewController.canMakePayments() && PKPaymentAuthorizationViewController.canMakePayments(usingNetworks: [.amex, .visa, .masterCard])
    }
    
    0 讨论(0)
提交回复
热议问题