Apple Pay


A dependency free Cordova plugin to provide Apple Pay functionality.


If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

Ionic 苹果支付 Apple Pay插件的安装(Installation)

ionic cordova plugin add cordova-plugin-applepay npm install @ionic-native/apple-pay
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/apple-pay

Ionic 苹果支付 Apple Pay插件支持的平台(Supported Platforms)

  • iOS

Ionic 苹果支付 Apple Pay插件的用法(Usage)

import { ApplePay } from '@ionic-native/apple-pay/ngx';

constructor(private applePay: ApplePay) { }

async applePay() {
  // This block is optional -- only if you need to update order items/shipping
  // methods in response to shipping method selections
    .subscribe(async selection => {
      try {
        await this.applePay.updateItemsAndShippingMethods({
          items: getFromSelection(selection),
          shippingMethods: getFromSelection(selection),
      catch {
        // handle update items error

  try {
    const applePayTransaction = await this.applePay.makePaymentRequest({
      billingAddressRequirement: ['name', 'email', 'phone'],
      shippingAddressRequirement: 'none',
      shippingType: 'shipping'

    const transactionStatus = await completeTransactionWithMerchant(applePayTransaction);
    await this.applePay.completeLastTransaction(transactionStatus);
  } catch {
    // handle payment request error
    // Can also handle stop complete transaction but these should normally not occur

  // only if you started listening before
  await this.applePay.stopListeningForShippingContactSelection();