0.0.2 • Published 16 days ago

capacitor-jd-apple-pay v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

capacitor-jd-apple-pay

This plugin serves as a wrapper for Apple Pay, facilitating the generation of an Apple Pay token and its subsequent transmission to the backend.

Feel free to open new PRs.. :)

Supported Platforms

  • iOS

Features

  • Wallet Availability Check: Verify whether the Apple Wallet is available on the device.
  • Payment Request: Initiate a payment request through Apple Pay and retrieve the payment token.
  • Payment Completion: Finalize the payment process after the token has been successfully sent to the backend.

Todo

  • Create tests.
  • Add support for ApplePayShippingContact.
  • Add support for ApplePayShippingMethod.

Install

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

API

canMakePayment()

canMakePayment() => Promise<{ success: boolean; }>

Returns: Promise<{ success: boolean; }>


completePayment(...)

completePayment(params: ApplePayCompleteRequest) => Promise<void>
ParamType
paramsApplePayCompleteRequest

requestPayment(...)

requestPayment(params: ApplePayPaymentRequest) => Promise<ApplePayResponseRequest>
ParamType
paramsApplePayPaymentRequest

Returns: Promise<ApplePayResponseRequest>


Interfaces

ApplePayCompleteRequest

PropType
status'success' | 'failure'

ApplePayResponseRequest

PropType
paymentDatastring
transactionIdentifierstring

ApplePayPaymentRequest

PropType
merchantIdentifierstring
merchantCapabilitiesApplePayMerchantCapability[]
supportedNetworksApplePaySupportedNetworks[]
totalApplePayLineItem
countryCodestring
currencyCodestring

Type Aliases

ApplePayMerchantCapability

'supports3DS' | 'supportsCredit' | 'supportsDebit'

ApplePaySupportedNetworks

'amex' | 'discover' | 'JCB' | 'masterCard' | 'visa'

ApplePayLineItem

{ amount: string; label: string; }

Author

  • Juan David - Initial work - juandl
0.0.2

16 days ago

0.0.1

19 days ago