Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juandl/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.
https://github.com/juandl/capacitor-jd-apple-pay
apple capacitorjs ionic ios javascript typescript
Last synced: about 1 month ago
JSON representation
This plugin serves as a wrapper for Apple Pay, facilitating the generation of an Apple Pay token and its subsequent transmission to the backend.
- Host: GitHub
- URL: https://github.com/juandl/capacitor-jd-apple-pay
- Owner: juandl
- Created: 2024-05-07T18:45:40.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-07-05T13:27:09.000Z (4 months ago)
- Last Synced: 2024-09-29T23:20:57.925Z (about 2 months ago)
- Topics: apple, capacitorjs, ionic, ios, javascript, typescript
- Language: Swift
- Homepage: https://npmjs.com/package/capacitor-jd-apple-pay
- Size: 56.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# 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
```bash
npm install capacitor-jd-apple-pay
npx cap sync
```## API
* [`canMakePayment()`](#canmakepayment)
* [`completePayment(...)`](#completepayment)
* [`requestPayment(...)`](#requestpayment)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)### canMakePayment()
```typescript
canMakePayment() => Promise<{ success: boolean; }>
```**Returns:**
Promise<{ success: boolean; }>
--------------------
### completePayment(...)
```typescript
completePayment(params: ApplePayCompleteRequest) => Promise
```| Param | Type |
| ------------ | --------------------------------------------------------------------------- |
| **`params`** |ApplePayCompleteRequest
|--------------------
### requestPayment(...)
```typescript
requestPayment(params: ApplePayPaymentRequest) => Promise
```| Param | Type |
| ------------ | ------------------------------------------------------------------------- |
| **`params`** |ApplePayPaymentRequest
|**Returns:**
Promise<ApplePayResponseRequest>
--------------------
### Interfaces
#### ApplePayCompleteRequest
| Prop | Type |
| ------------ | ----------------------------------- |
| **`status`** |'success' \| 'failure'
|#### ApplePayResponseRequest
| Prop | Type |
| --------------------------- | ------------------- |
| **`paymentData`** |string
|
| **`transactionIdentifier`** |string
|#### ApplePayPaymentRequest
| Prop | Type |
| -------------------------- | ------------------------------------------------------------- |
| **`merchantIdentifier`** |string
|
| **`merchantCapabilities`** |ApplePayMerchantCapability[]
|
| **`supportedNetworks`** |ApplePaySupportedNetworks[]
|
| **`total`** |ApplePayLineItem
|
| **`countryCode`** |string
|
| **`currencyCode`** |string
|### Type Aliases
#### ApplePayMerchantCapability
'supports3DS' | 'supportsCredit' | 'supportsDebit'
#### ApplePaySupportedNetworks
'amex' | 'discover' | 'JCB' | 'masterCard' | 'visa'
#### ApplePayLineItem
{ amount: string; label: string; }
## Author
- **Juan David** - *Initial work* - [juandl](https://github.com/juandl)