1.0.12 • Published 7 months ago

zeply.applepay-capacitor-plugin v1.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

zeply.applepay-capacitor-plugin

@fresha/capacitor-plugin-applepay

npm version

This Apple Pay plugin provides interfaces that allow you to initiate an Apple Pay payment sheet based on provided PaymentRequest. When transaction is authorized, Payment response is returned along with payment details and more importantly- a payment token that you should pass to your backend.

For Capacitor 4 please use version 4.0.0+ For Capacitor 3 please use lower versions.

Install

npm install @fresha/capacitor-plugin-applepay
npx cap sync

Configuration

Before using this plugin, make sure that your project is correctly configured. Usually your Payment Services Processor will provide detailed instructions, so please read their docs first.

Apple Developer Portal:

  • Add your Merchant identifier
  • Contact with your PSP who will generate CSR that you should pass into Apple Pay Payment Processing Certificate
  • Send the generated certificate to your PSP
  • Edit your App Identifier, add Apple Pay Payment Processing capability, select previously created merchant ID.
  • Renew your provisioning profiles

Xcode

  • Add Apple Pay capability
  • Select previously created merchant identifier
  • Make sure you are using renewed provisioning profiles

API

canMakePayments()

canMakePayments() => any

Indicates whether the device supports Apple Pay.

Returns: any


canMakePayments(...)

canMakePayments(options: CanMakePaymentsRequest) => any

Indicates whether the device supports Apple Pay and whether the user has an active card. This allows more granular control than regular canMakePayments()

ParamTypeDescription
optionsCanMakePaymentsRequest- Supported networks and capabilities

Returns: any


initiatePayment(...)

initiatePayment(request: InitiatePaymentRequest) => any

Initiates a payment base on PaymentRequest object.

ParamTypeDescription
requestInitiatePaymentRequest- PaymentRequest object that will be used for the payment.

Returns: any


completeLastPayment(...)

completeLastPayment(request: CompletePaymentRequest) => any

Completes current payment

ParamTypeDescription
requestCompletePaymentRequest- CompletePaymentRequest object containing status

Returns: any


Interfaces

CanMakePaymentsResponse

PropType
canMakePaymentsboolean

CanMakePaymentsRequest

PropType
networks{}
capabilities{}

InitiatePaymentRequest

PropType
merchantIdentifierstring
countryCodestring
currencyCodestring
supportedCountries{}
supportedNetworks{}
summaryItems{}
requiredShippingContactFields{}
requiredBillingContactFields{}
merchantCapabilities{}
billingContactPaymentContact
shippingContactPaymentContact

PaymentSummaryItem

PropType
labelstring
amountstring
typePaymentSummaryItemType

PaymentContact

PropType
emailAddressstring
phoneNumberstring
namePersonNameComponents
postalAddress{ street?: string; city?: string; postalCode?: string; country?: string; isoCountryCode?: string; subAdministrativeArea?: string; subLocality?: string; }

PersonNameComponents

PropType
familyNamestring
givenNamestring
namePrefixstring
middleNamestring
nameSuffixstring
nicknamestring

InitiatePaymentResponse

PropType
token{ paymentData?: string; transactionIdentifier: string; paymentMethod: { displayName?: string; secureElementPass?: { deviceAccountNumberSuffix: string; deviceAccountIdentifier: string; primaryAccountIdentifier: string; primaryAccountNumberSuffix: string; devicePassIdentifier?: string; pairedTerminalIdentifier?: string; }; }; }
billingContactPaymentContact
shippingContactPaymentContact

CompletePaymentRequest

PropType
statusPaymentCompletionStatus

Type Aliases

PaymentNetwork

'amex' | 'chinaUnionPay' | 'cartesBancaires' | 'discover' | 'eftpos' | 'electron' | 'idCredit' | 'interac' | 'JCB' | 'maestro' | 'masterCard' | 'privateLabel' | 'quicPay' | 'suica' | 'visa' | 'vPay'

MerchantCapability

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

PaymentSummaryItemType

'pending' | 'final'

ContactField

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

PaymentCompletionStatus

'success' | 'failure'

1.0.12

7 months ago

1.0.11

7 months ago

5.0.11

8 months ago

5.0.10

9 months ago

5.0.9

9 months ago

5.0.6

9 months ago

5.0.5

9 months ago

5.0.4

9 months ago

5.0.3

9 months ago