@capacitor-community/apple-pay
Capacitor Plugin used to enable Apple Pay in an Application
| Maintainer | GitHub | Social |
|---|---|---|
| Capacitor Community | capacitor-community |
npm install @capacitor-community/apple-pay
npx cap syncA working example can be found in the example-app directory.
setLogLevel(level: LogLevel) => voidSet the verbosity of event logging.
| Param | Type |
|---|---|
level |
LogLevel |
canMakePayments(options: ApplePayAvailabilityOptions) => Promise<ApplePayCanMakePaymentsResponse>Checks if the device supports Apple Pay and can make payments, based on the supplied options.
| Param | Type |
|---|---|
options |
ApplePayAvailabilityOptions |
Returns: Promise<ApplePayCanMakePaymentsResponse>
makePaymentRequest(request: ApplePayRequest) => Promise<ApplePayPaymentRequestResponse>Attempts to make request payment by presenting the payment sheet over the app.
| Param | Type |
|---|---|
request |
ApplePayRequest |
Returns: Promise<ApplePayPaymentRequestResponse>
The response object from {@link ApplePay.canMakePayments}
| Prop | Type | Description |
|---|---|---|
canMakePayments |
boolean |
- Type: boolean Whether or not the device can make payments. |
A config object for {@link ApplePay.canMakePayments}
| Prop | Type | Description |
|---|---|---|
merchantIdentifier |
string |
- Type: string The merchant identifier you registered with Apple for use with Apple Pay. |
supportedNetworks |
ApplePaySupportedNetwork[] |
- Type: {@link ApplePaySupportedNetwork} An array of supported networks that will be supported. |
The response object from {@link ApplePay.makePaymentRequest}
| Prop | Type | Description |
|---|---|---|
success |
boolean |
- Type: boolean Whether or not the payment request was successful. |
data |
any |
- Type: any The data response from the merchant validation server. |
| Prop | Type | Description |
|---|---|---|
version |
1 | 2 | 5 | 4 | 3 |
- Type: 1 | 2 | 3 | 4 | 5 The version of Apple Pay the app supports. |
merchantValidation |
ApplePayMerchantValidation |
- Type: {@link ApplePayMerchantValidation} An object containing merchant validation settings. |
paymentAuthorization |
ApplePayPaymentAuthorization |
- Type: {@link ApplePayPaymentAuthorization} An object containing merchant payment authorization settings. |
request |
ApplePayPaymentRequest |
- Type: {@link ApplePayPaymentRequest} The payment request object. |
An object containing settings for connecting with your merchant validation server.
| Prop | Type | Description |
|---|---|---|
url |
string |
- Type: string The url to your merchant validation server. If your application will only be used natively then this value can be set to undefined. |
params |
ApplePayMerchantValidationParams |
- Type: {@link ApplePayMerchantValidationParams} Additional params that will be POSTed to the the merchant validation server. |
An object containing request parameters for server-side merchant validation.
| Prop | Type | Description |
|---|---|---|
merchantIdentifier |
string |
- Type: string The merchant identifier you registered with Apple for use with Apple Pay. |
displayName |
string |
- Type: string The display name of your store, UTF-8, unlocalized, with a max length of 64 characters. |
initiative |
'web' | 'native' |
- Type: web The type of the app making the request. This value should be set to web. It is ignored when run natively. |
initiativeContext |
string |
- Type: string This value should be your fully qualified domain name associated with your Apple Pay Merchant Identity Certificate. |
An object containing settings for connecting with your merchant payment authorization server.
| Prop | Type | Description |
|---|---|---|
url |
string |
- Type: string The url to your merchant payment authorization server. |
An object describing the payment request, including information about payment processing capabilities, payment amounts and more.
| Prop | Type | Description |
|---|---|---|
countryCode |
string |
- Type: string The merchant’s two-letter ISO 3166 country code. |
currencyCode |
string |
- Type: string The three-letter ISO 4217 currency code for the payment. |
merchantCapabilities |
ApplePayMerchantCapability[] |
- Type: {@link ApplePayMerchantCapability} The payment capabilities supported by the merchant. |
supportedNetworks |
ApplePaySupportedNetwork[] |
- Type: {@link ApplePaySupportedNetwork} The payment networks the merchant supports. |
lineItems |
ApplePaySummaryItem[] |
- Type: {@link ApplePaySummaryItem} A set of line items that explain recurring payments and additional charges and discounts. |
total |
ApplePaySummaryItem |
- Type: {@link ApplePaySummaryItem} A line item representing the total for the payment. |
An object that defines a line item in a payment request.
| Prop | Type | Description | Default |
|---|---|---|---|
label |
string |
- Type: string The name of the line item (ex.: product name). |
|
amount |
string |
- Type: string The line item amount. |
|
type |
'pending' | 'final' |
- Type: pending | final Whether or not the line item represents a known final cost or an estimated or unknown cost. |
|
| Members | Description |
|---|---|
DEBUG |
Log events that may be useful during development. |
ERROR |
Only log errors. |
| Members | Value | Description |
|---|---|---|
AMEX |
'amex' |
American Express |
CARTESBANCAIRES |
'cartesBancaires' |
Cartes Bancaires |
CHINAUNIONPAY |
'chinaUnionPay' |
China Union Pay |
DISCOVER |
'discover' |
Discover Card |
EFTPOS |
'eftpos' |
Electronic funds transfer at point of sale |
ELECTRON |
'electron' |
Visa Electron |
ELO |
'elo' |
Elo |
INTERAC |
'interac' |
Interac |
JCB |
'jcb' |
Japan Credit Bureau |
MADA |
'mada' |
Saudi Payments Network |
MAESTRO |
'maestro' |
Maestro Debit Card |
MASTERCARD |
'masterCard' |
Mastercard |
PRIVATELABEL |
'privateLabel' |
Store credit and debit cards |
VISA |
'visa' |
Visa |
VPAY |
'vPay' |
Visa vPay |
| Members | Value | Description |
|---|---|---|
THREEDS |
'supports3DS' |
Support the 3D Secure protocol |
DEBIT |
'supportsDebit' |
Support for debit cards |
CREDIT |
'supportsCredit' |
Support for credit cards |
EMV |
'supportsEMV' |
Support for the EMV protocol |
