1.0.20 • Published 10 months ago

terminal-gateway v1.0.20

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

Terminal

Browser Support

ChromeEdgeOpera
Latest ✔Latest ✔Latest ✔

Installation

Using npm:

$ npm install terminal-gateway

Using yarn:

$ yarn add terminal-gateway

Congfiguration

KeyTypeDefaultDescription
keyStringprovide by ABA
timeoutNumber60000 in millisecondsThe Terminal's expiration time
onSuccessFunctionThe callback function will respond with two parameters
onErrorFunctionThe callback function will respond with two parameters

Initiation

  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 | |

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 nameData typeRequireDefaultDescription
invoiceStringYesThe invoice number must be unique. example: INV0011620291635
terminal.onEnquiry({
  invoice: 'INV0011620291635'
});

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.

terminal.onCancel()
1.0.18

11 months ago

1.0.17

11 months ago

1.0.16

11 months ago

1.0.8

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.20

10 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago