Skip to content

foodkit/capacitor-apple-pay-plugin

Repository files navigation

capacitor-apple-pay-plugin

A Capacitor plugin for Apple Pay

Install

npm install capacitor-apple-pay-plugin
npx cap sync

API

canMakePayments()

canMakePayments() => Promise<{ isPayment: boolean; }>

Returns: Promise<{ isPayment: boolean; }>


canMakePayments(...)

canMakePayments(options: CanMakePaymentsNetworks) => Promise<{ isPayment: boolean; }>
Param Type
options CanMakePaymentsNetworks

Returns: Promise<{ isPayment: boolean; }>


makePaymentRequest(...)

makePaymentRequest(request: PaymentRequest) => Promise<PaymentResponse>
Param Type
request PaymentRequest

Returns: Promise<PaymentResponse>


completeLastTransaction(...)

completeLastTransaction(options: { status: string; }) => Promise<void>
Param Type
options { status: string; }

Interfaces

CanMakePaymentsNetworks

Prop Type
usingNetworks PaymentNetwork[]
capabilities MerchantCapability[]

PaymentResponse

Prop Type
token { paymentData?: string; transactionIdentifier: string; paymentMethod: { displayName?: string; secureElementPass?: { deviceAccountNumberSuffix: string; deviceAccountIdentifier: string; primaryAccountIdentifier: string; primaryAccountNumberSuffix: string; devicePassIdentifier?: string; pairedTerminalIdentifier?: string; }; }; }

PaymentRequest

Prop Type
merchantIdentifier string
countryCode string
currencyCode string
supportedCountries string[]
supportedNetworks PaymentNetwork[]
paymentSummaryItems PaymentSummaryItem[]
requiredShippingContactFields ContactField[]
requiredBillingContactFields ContactField[]
merchantCapabilities MerchantCapability[]
billingContact PaymentContact
shippingContact PaymentContact

PaymentSummaryItem

Prop Type
label string
amount number
type PaymentSummaryItemType

PaymentContact

Prop Type
emailAddress string
phoneNumber string
name PersonNameComponents
postalAddress { street?: string; city?: string; postalCode?: string; country?: string; isoCountryCode?: string; subAdministrativeArea?: string; subLocality?: string; }

PersonNameComponents

Prop Type
familyName string
givenName string
namePrefix string
middleName string
nameSuffix string
nickname string
phoneticRepresentation PersonNameComponents

Type Aliases

PaymentNetwork

'masterCard' | 'visa' | 'amex' | 'quicPay' | 'chinaUnionPay' | 'discover' | 'interac' | 'privateLabel'

MerchantCapability

'capability3DS' | 'capabilityCredit' | 'capabilityDebit' | 'capabilityEMV'

PaymentSummaryItemType

'pending' | 'final'

ContactField

'emailAddress' | 'name' | 'phoneNumber' | 'phoneticName' | 'postalAddress'