Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 0 additions & 270 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ The Checkout Frontend Library is a Bold Javascript library, which contains reusa

* Call Bold's [Headless Checkout APIs](https://developer.boldcommerce.com/default/guides/checkout)
* Control request retry
* Communicate to the [PIGI API](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api)
* Get useful types and constants to avoid defining interfaces

## Installation
Expand Down Expand Up @@ -712,275 +711,6 @@ Removes a gift card payment by `id`.

A promise that resolves the API response.

### Payment Iframe

---

#### Get Payment Iframe

▸ **getPaymentIframeUrl**(): Promise <[IApiReturnObject](./docs/interfaces/IApiReturnObject.md)>

Retrieve the Payment Isolation Gateway Interface ([PIGI](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi)) url.

```typescript
const response: IApiReturnObject = await getPaymentIframeUrl();
```

**Returns**

`Promise`<[IApiReturnObject](./docs/interfaces/IApiReturnObject.md)>

A promise that resolves the API response.

---

#### CSS Styling for PIGI

▸ **cssStylingPaymentIframe**(`body`,`numOfRetries?`): Promise <[IApiReturnObject](./docs/interfaces/IApiReturnObject.md)>

Styles the Payment Isolation Gateway Interface (PIGI) using CSS and media queries.

```typescript
const response: IApiReturnObject = await cssStylingPaymentIframe(body, API_RETRY);
```

**Parameters**

| Parameter| type| Description|
| ---------| ----|-----------|
| `body`| [ICssStylingPaymentIframeRequest](./docs/interfaces/ICssStylingPaymentIframeRequest.md)| The css and media rules that need to be applied to PIGI Iframe. |
| `numOfRetries?`| `number`| The number of times to retry the API in case of a 408, 429, 503, 504, or 544 error. The default is 0. |

**Returns**

`Promise`<[IApiReturnObject](./docs/interfaces/IApiReturnObject.md)>

A promise that resolves the API response.


### PIGI Actions

---

#### Set PIGI Listener

▸ **setPigiListener**(`iFrameId`, `callback`): void

Sets the callback function that will receive all action responses from PIGI. The callback function is executed when the parent receives any response from PIGI. You can also implement [PIGI event driven responses](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#event-driven-responses) in the callback function.
```typescript

const handlePigiMessage = (e) => {
const {responseType, payload} = e.data as IPigiResponseData;
// Implement all action responses by responseType
}

setPigiListener(IframeId, handlePigiMessage);
```

**Parameters**

| Parameter| type| Description|
| ---------| ----|-----------|
| `iFrameId`| `string`| The unique identifier for the PIGI Iframe. |
| `callback`| `EventListenerOrEventListenerObject`| The callback function to call when PIGI responses are received. |


---

#### Add Payment Action

▸ **sendAddPaymentAction**(): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendAddPaymentActionAsync**(): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The [Add payment PIGI action](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#add-payment) requests that PIGI adds the payment token to the order after customer enters the payment information.

```typescript
const response: IApiReturnObject = sendAddPaymentAction();
const responseAsync: IPigiResponseType = await sendAddPaymentActionAsync();
```

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---

#### Clear PIGI Error Action

▸ **sendClearErrorMessageAction**(): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendClearErrorMessageActionAsync**(): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The [Clear PIGI error action](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#clear-error-messages) removes all errors from the PIGI user interface.

```typescript
const response: IApiReturnObject = sendClearErrorMessageAction();
const responseAsync: IPigiResponseType = await sendClearErrorMessageActionAsync();
```

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---

#### Display Error Message

▸ **sendDisplayErrorMessageAction**(`message`, `subType`): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendDisplayErrorMessageActionAsync**(`message`, `subType`): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The [Display error message action](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#display-error-message) displays an error message in the PIGI user interface.

```typescript
const response: IApiReturnObject = sendDisplayErrorMessageAction(message, subType);
const responseAsync: IPigiResponseType = await sendDisplayErrorMessageActionAsync(message, subType);
```

**Parameters**

| Parameter| type| Description|
| ---------| ----|-----------|
| `message`| `string`| The error message to display in PIGI. |
| `subType`| `string`| The type of error, corresponds to payment gateway name.|

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---

#### Handle SCA Action

▸ **sendHandleScaAction**(`clientSecretToken?`): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendHandleScaActionAsync**(`clientSecretToken?`): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The Handle SCA action requests that PIGI handles SCA/3DS.

```typescript
const response: IApiReturnObject = sendHandleScaAction(clientSecretToken);
const responseAsync: IApiReturnObject = await sendHandleScaAction(clientSecretToken);
```

**Parameters**

| Parameter| type| Description|
| ---------| ----|-----------|
| `clientSecretToken?`| `string`| The secret token from payment gateway. |

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---

#### Refresh Order Action

▸ **sendRefreshOrderAction**(): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendRefreshOrderActionAsync**(): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The [Refresh Order action](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#refresh-order) updates the order state in PIGI.

```typescript
const response: IApiReturnObject = sendRefreshOrderAction();
const responseAsync: IPigiResponseType = await sendRefreshOrderActionAsync();
```

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---

#### Select Payment Action

▸ **sendSelectPaymentMethodAction**(`payload`): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendSelectPaymentMethodActionAsync**(`payload`): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The [Select Payment Method action](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#select-payment-method) selects the customer's choice of payment.

```typescript
const response: IApiReturnObject = sendSelectPaymentMethodAction(payload);
const responseAsync: IPigiResponseType = await sendSelectPaymentMethodActionAsync(payload);
```

**Parameters**

| Parameter| type| Description|
| ---------| ----|-----------|
| `payload`| `{index?: number, gatewayName?: string}`| Provide an object with either the `index` or `gatewayName`. If both are used, PIGI uses index. |

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---


#### Update Language Action

▸ **sendUpdateLanguageAction**(`languageCode`): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendUpdateLanguageActionAsync**(`languageCode`): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The [Update Language action](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#update-language) changes the display language of PIGI.

```typescript
const response: IApiReturnObject = sendUpdateLanguageAction(languageCode);
const responseAsync: IPigiResponseType = await sendUpdateLanguageActionAsync(languageCode);
```

**Parameters**

| Parameter| type| Description|
| ---------| ----|-----------|
| `languageCode`| `string`| The updated language code in [ISO 639-1](https://www.iso.org/standard/22109.html). |

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---


#### Update Media Match Action

▸ **sendUpdateMediaMatchAction**(`conditionText`, `matches`): [IApiReturnObject](./docs/interfaces/IApiReturnObject.md)<br />
▸ **sendUpdateMediaMatchActionAsync**(`conditionText`, `matches`): Promise <[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

The [Update Media Match action](https://developer.boldcommerce.com/default/guides/checkout/checkout-pigi-api#update-media-match) changes the CSS styling of PIGI.

```typescript
const response: IApiReturnObject = sendUpdateMediaMatchAction(conditionText, matches);
const responseAsync: IPigiResponseType = await sendUpdateMediaMatchActionAsync(conditionText, matches);
```

**Parameters**

| Parameter| type| Description|
| ---------| ----|-----------|
| `conditionText`| `string`| The media rule condition. |
| `matches`| `boolean`| Whether or not the condition was met. |

**Returns**

[IApiReturnObject](./docs/interfaces/IApiReturnObject.md) | `Promise`<[IPigiResponseType](./docs/interfaces/IPigiResponseType.md)>

An API response or promise that resolve the PIGI response.

---

### State

The Bold Checkout Frontend Library keeps a local copy of the most up-to-date application state, which is updated after every API call. Use the methods in this section to retrieve certain information about your order. To see the latest order status, you can also call the [Get Application State](#get-application-state) endpoint.
Expand Down
7 changes: 0 additions & 7 deletions docs/interfaces/IApiErrors.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- [noAppState](IApiErrors.md#noappstate)
- [noCsrf](IApiErrors.md#nocsrf)
- [noFieldInResponse](IApiErrors.md#nofieldinresponse)
- [noPigiIframe](IApiErrors.md#nopigiiframe)
- [noResData](IApiErrors.md#noresdata)

## Properties
Expand Down Expand Up @@ -72,12 +71,6 @@ ___

___

### noPigiIframe

• **noPigiIframe**: [`IErrorFormat`](IErrorFormat.md)

___

### noResData

• **noResData**: [`IErrorFormat`](IErrorFormat.md)
13 changes: 0 additions & 13 deletions docs/interfaces/IPigi.md

This file was deleted.

20 changes: 0 additions & 20 deletions docs/interfaces/IPigiActionType.md

This file was deleted.

Loading