Skip to content
capacitor-communityPublic

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation


Apple Pay

@capacitor-community/apple-pay

Capacitor Plugin used to enable Apple Pay in an Application

Maintainers

Maintainer GitHub Social
Capacitor Community capacitor-community

Documentation

Installation

npm install @capacitor-community/apple-pay
npx cap sync

Demo

A working example can be found in the example-app directory.

API

setLogLevel(...)

setLogLevel(level: LogLevel) => void

Set the verbosity of event logging.

Param Type
level LogLevel

canMakePayments(...)

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(...)

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>


Interfaces

ApplePayCanMakePaymentsResponse

The response object from {@link ApplePay.canMakePayments}

Prop Type Description
canMakePayments boolean - Type: boolean Whether or not the device can make payments.

ApplePayAvailabilityOptions

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.

ApplePayPaymentRequestResponse

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.

ApplePayRequest

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.

ApplePayMerchantValidation

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.

ApplePayMerchantValidationParams

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.

ApplePayPaymentAuthorization

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.

ApplePayPaymentRequest

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.

ApplePaySummaryItem

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. undefined

Enums

LogLevel

Members Description
DEBUG Log events that may be useful during development.
ERROR Only log errors.

ApplePaySupportedNetwork

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

ApplePayMerchantCapability

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

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages