Apple Pay
A dependency free Cordova plugin to provide Apple Pay functionality.
Cordovaの問題で困っていますか?

本格的なプロジェクトを構築している場合、トラブルシューティングに時間を費やす余裕はありません。Ionicのエキスパートが、保守、サポート、統合に関する公式サポートを提供しています。
インストール
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、 エンタープライズプラグインに興味があれば 連絡ください
サポートしているプラットフォーム
- iOS
利用方法
React
Angular
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
this.applePay.startListeningForShippingContactSelection()
.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({
items,
shippingMethods,
merchantIdentifier,
currencyCode,
countryCode,
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();
}