Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from fresha/fix-types
Browse files Browse the repository at this point in the history
v1.0.1: Update canMakePayments typing and docs
  • Loading branch information
kondratk authored Jul 27, 2022
2 parents b2ea1db + f135a8c commit 4904e43
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
46 changes: 32 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Before using this plugin, make sure that your project is correctly configured. U

<docgen-index>

- [`canMakePayments()`](#canmakepayments)
- [`canMakePayments(...)`](#canmakepayments)
- [`initiatePayment(...)`](#initiatepayment)
- [`completeLastPayment(...)`](#completelastpayment)
- [Interfaces](#interfaces)
- [Type Aliases](#type-aliases)
* [`canMakePayments()`](#canmakepayments)
* [`canMakePayments(...)`](#canmakepayments)
* [`initiatePayment(...)`](#initiatepayment)
* [`completeLastPayment(...)`](#completelastpayment)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

Expand All @@ -56,7 +56,8 @@ Indicates whether the device supports Apple Pay.

**Returns:** <code>Promise&lt;<a href="#canmakepaymentsresponse">CanMakePaymentsResponse</a>&gt;</code>

---
--------------------


### canMakePayments(...)

Expand All @@ -73,7 +74,8 @@ This allows more granular control than regular `canMakePayments()`

**Returns:** <code>Promise&lt;<a href="#canmakepaymentsresponse">CanMakePaymentsResponse</a>&gt;</code>

---
--------------------


### initiatePayment(...)

Expand All @@ -89,7 +91,8 @@ Initiates a payment base on PaymentRequest object.

**Returns:** <code>Promise&lt;<a href="#initiatepaymentresponse">InitiatePaymentResponse</a>&gt;</code>

---
--------------------


### completeLastPayment(...)

Expand All @@ -103,22 +106,26 @@ Completes current payment
| ------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| **`request`** | <code><a href="#completepaymentrequest">CompletePaymentRequest</a></code> | - <a href="#completepaymentrequest">CompletePaymentRequest</a> object containing status |

---
--------------------


### Interfaces


#### CanMakePaymentsResponse

| Prop | Type |
| --------------------- | -------------------- |
| **`canMakePayments`** | <code>boolean</code> |


#### CanMakePaymentsRequest

| Prop | Type |
| ------------------- | --------------------------------- |
| **`usingNetworks`** | <code>PaymentNetwork[]</code> |
| **`capabilities`** | <code>MerchantCapability[]</code> |
| Prop | Type |
| ------------------ | --------------------------------- |
| **`networks`** | <code>PaymentNetwork[]</code> |
| **`capabilities`** | <code>MerchantCapability[]</code> |


#### InitiatePaymentResponse

Expand All @@ -128,6 +135,7 @@ Completes current payment
| **`billingContact`** | <code><a href="#paymentcontact">PaymentContact</a></code> |
| **`shippingContact`** | <code><a href="#paymentcontact">PaymentContact</a></code> |


#### PaymentContact

| Prop | Type |
Expand All @@ -137,6 +145,7 @@ Completes current payment
| **`name`** | <code><a href="#personnamecomponents">PersonNameComponents</a></code> |
| **`postalAddress`** | <code>{ street?: string; city?: string; postalCode?: string; country?: string; isoCountryCode?: string; subAdministrativeArea?: string; subLocality?: string; }</code> |


#### PersonNameComponents

| Prop | Type |
Expand All @@ -148,6 +157,7 @@ Completes current payment
| **`nameSuffix`** | <code>string</code> |
| **`nickname`** | <code>string</code> |


#### InitiatePaymentRequest

| Prop | Type |
Expand All @@ -164,6 +174,7 @@ Completes current payment
| **`billingContact`** | <code><a href="#paymentcontact">PaymentContact</a></code> |
| **`shippingContact`** | <code><a href="#paymentcontact">PaymentContact</a></code> |


#### PaymentSummaryItem

| Prop | Type |
Expand All @@ -172,30 +183,37 @@ Completes current payment
| **`amount`** | <code>string</code> |
| **`type`** | <code><a href="#paymentsummaryitemtype">PaymentSummaryItemType</a></code> |


#### CompletePaymentRequest

| Prop | Type |
| ------------ | --------------------------------------------------------------------------- |
| **`status`** | <code><a href="#paymentcompletionstatus">PaymentCompletionStatus</a></code> |


### Type Aliases


#### PaymentNetwork

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


#### MerchantCapability

<code>'capability3DS' | 'capabilityCredit' | 'capabilityDebit' | 'capabilityEMV'</code>


#### PaymentSummaryItemType

<code>'pending' | 'final'</code>


#### ContactField

<code>'emailAddress' | 'name' | 'phoneNumber' | 'phoneticName' | 'postalAddress'</code>


#### PaymentCompletionStatus

<code>'success' | 'failure'</code>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fresha/capacitor-plugin-applepay",
"version": "1.0.0",
"version": "1.0.1",
"description": "Apple Pay plugin for Capacitor",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -72,4 +72,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export declare type MerchantCapability =
export declare type PaymentCompletionStatus = 'success' | 'failure';

export interface CanMakePaymentsRequest {
usingNetworks: PaymentNetwork[];
networks: PaymentNetwork[];
capabilities?: MerchantCapability[];
}

Expand Down

0 comments on commit 4904e43

Please sign in to comment.