# computop-node-client

> This package is designed to provide a simple start with Computop's Paygate

Latest version **0.2.7** (published 2023-10-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install computop-node-client
pnpm add computop-node-client
yarn add computop-node-client
bun add computop-node-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.7 |
| Published | 2023-10-27 |
| First published | 2021-12-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tobias Kloy |
| Maintainers | vcircle |
| Keywords | computop, paygate, Computop Paygate |

## Links

- npm: https://www.npmjs.com/package/computop-node-client
- npm.io page: https://npm.io/package/computop-node-client

## Dependencies (2)

- [dotenv](https://npm.io/package/dotenv.md) ^10.0.0
- [egoroof-blowfish](https://npm.io/package/egoroof-blowfish.md) ^2.2.2

## Recent versions

- 0.2.7 (latest) — 2023-10-27
- 0.2.6 — 2023-04-21
- 0.2.5 — 2023-04-21
- 0.2.4 — 2023-04-21
- 0.2.3 — 2023-04-17
- 0.2.2 — 2023-03-15
- 0.2.1 — 2023-03-15
- 0.2.0 — 2023-03-15
- 0.1.9 — 2021-12-15
- 0.1.8 — 2021-12-15
- 0.1.7 — 2021-12-15
- 0.1.6 — 2021-12-15
- 0.1.5 — 2021-12-15
- 0.1.4 — 2021-12-15
- 0.1.3 — 2021-12-15
- … 2 more at https://npm.io/package/computop-node-client/versions

## README

# computop-node-client
This module is designed to help you integrate Computop Paygate more easily into your Node.js application. 
For this purpose, it contains classes for encryption and decryption, for generating a SHA-256 MAC hash, and for converting a key-value pair string into a JSON object.

## Install
```bash
npm install --save
```
2) Create a file named ".env" and store your Computop keys like this: 
```bash
KEY_BLOWFISH=<BF Key goes here>  
KEY_HMAC=<MAC key goes here>  
```

## Usage
```bash
const computop = require('computop-node-client')
```
### Encrypt to blowfish
```bash
computop.encryptBlowfish('Hello world');
```

### Decrypt from blowfish
```bash
computop.decryptBlowfish('3FBEA4D5D8AD6CEE824F5BD7B5D6730FF41E214E67D515EC');
```

### Encrypt to AES
```bash
computop.encryptAES('Hello world');
```

### Decrypt from AES
```bash
computop.decryptAES('C0C8D486569F39C4DE13B2CA13697A92-50A271A52F8A72665DBE92A91DF1FB34BCC5752BD3A43E0D');
```

### generate hash
```bash
computop.generateHash('123*Hello*World');
```

### Convert JS object to key-value pairs
```bash
let myObject = {}
myObject.MerchantID = "myMID";
myObject.Amount = "100";

computop.buildRequest(myObject);
```

### Parse response
```bash
computop.parseResponse('mid=YourMID&code=00000000&status=success);
```

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