# terminal-gateway

> POS SDK is a library that allows users to perform sale transactions on a terminal from a web browser.

Latest version **1.0.24** (published 2026-01-28) · 0 weekly downloads

## Install

```sh
npm install terminal-gateway
pnpm add terminal-gateway
yarn add terminal-gateway
bun add terminal-gateway
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.24 |
| Published | 2026-01-28 |
| First published | 2022-09-13 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bundara-reuk, vibol, din.lyhor |
| Keywords | terminal, sdk, terminal-gateway |

## Links

- npm: https://www.npmjs.com/package/terminal-gateway
- npm.io page: https://npm.io/package/terminal-gateway

## Dependencies (1)

- [crypto-js](https://npm.io/package/crypto-js.md) ^4.1.1

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.24 (latest) — 2026-01-28
- 1.0.23 — 2026-01-21
- 1.0.22 — 2026-01-21
- 1.0.21 — 2026-01-21
- 1.0.20 — 2023-07-20
- 1.0.18 — 2023-06-20
- 1.0.17 — 2023-06-20
- 1.0.16 — 2023-06-20
- 1.0.15 — 2023-06-20
- 1.0.14 — 2023-06-20
- 1.0.13 — 2023-06-20
- 1.0.12 — 2023-06-20
- 1.0.11 — 2023-06-20
- 1.0.10 — 2023-06-20
- 1.0.8 — 2023-06-20
- … 6 more at https://npm.io/package/terminal-gateway/versions

## README

# Terminal

## Browser Support

![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png) | ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_48x48.png) |![Opera](https://raw.githubusercontent.com/alrra/browser-logos/main/src/opera/opera_48x48.png)  |
--- | --- | --- | 
Latest ✔ | Latest ✔ | Latest ✔ |


## Installation

Using npm:

```bash
$ npm install terminal-gateway
```

Using yarn:

```bash
$ yarn add terminal-gateway
```

## Congfiguration

| Key | Type| Default| Description|
| --- | --- | --- | --- |
| key | String |  | provide by ABA    |
| timeout | Number | `60000` in milliseconds | The Terminal's expiration time |
| onSuccess | Function |  | The callback function will respond with two parameters |
| onError | Function | | The callback function will respond with two parameters |

## Initiation

``` javascript 
  import Terminal from 'terminal-gateway'
  
  const terminal = new Terminal({
    key: '',
    timeout: 50000, 
    onSuccess: () => {}
    onError: () => {}
  });
```
## Sale transaction
__onSale():__ This method allows you to do sale transactions. user needs to call this function to get the result failed or successful. It is required four parameters:
| Parameter name	| Data type | Require | Default	| Description |
| --- | --- | --- | --- | --- | 
| amount | 	String | 	Yes |	0 |	amount define transaction |
| type |	String |	Yes	 | SHOWQR	| SHOWQR: sale by screen QR codeEDC: sale by card |
| invoice |	String	| Yes	| The invoice number must be unique. Example: INV0011620291635 | |

<br />

``` javascript 
terminal.onSale({
  amount: '0.01', 
  type: 'SHOWQR', 
  currency: 'USD', 
  invoice: 'INV0011620291635'
});
```
## Enquiry transaction
__onEnquiry():__ This method allows you to receive the response back with the result status of the transaction whether it's successful or failed. It is required a parameter:

| Parameter name |	Data type |	Require	| Default	| Description |
| --- | --- | --- | --- | --- | 
| invoice	| String	| Yes	| | The invoice number must be unique. example: `INV0011620291635`|

<br /> 

``` javascript 
terminal.onEnquiry({
  invoice: 'INV0011620291635'
});
```

<br /> 

## Void transaction
__onVoid():__ This method allows you to void the transaction. It is required a parameter:
| Parameter name |	Data type |	Require	| Default	|Description |
| --- | --- | --- | --- | --- | 
| traceId	| String	| Yes	| | trace number of sale transaction response |


## Cancelation transaction
__onCancel():__ This method allows the cancellation of the sale of the transaction.
``` javascript
terminal.onCancel()
```

---
_Source: https://npm.io/package/terminal-gateway · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
