# node-easypay

> Node module for Easypay API.

Latest version **0.0.6** (published 2018-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-easypay
pnpm add node-easypay
yarn add node-easypay
bun add node-easypay
```

## 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.0.6 |
| Published | 2018-10-18 |
| First published | 2018-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | noglik |
| Maintainers | noglik |
| Keywords | easypay |

## Links

- npm: https://www.npmjs.com/package/node-easypay
- Repository: https://github.com/menavita/node-easypay
- Homepage: https://github.com/menavita/node-easypay#readme
- Issues: https://github.com/menavita/node-easypay/issues
- npm.io page: https://npm.io/package/node-easypay

## Dependencies (4)

- [q](https://npm.io/package/q.md) ^1.5.1
- [iconv](https://npm.io/package/iconv.md) ^2.3.0
- [xml2js](https://npm.io/package/xml2js.md) ^0.4.19
- [request](https://npm.io/package/request.md) ^2.85.0

## Recent versions

- 0.0.6 (latest) — 2018-10-18
- 0.0.5 — 2018-10-18
- 0.0.4 — 2018-04-13
- 0.0.3 — 2018-04-12
- 0.0.2 — 2018-04-11
- 0.0.1 — 2018-03-21

## README

# node-easypay
Node module for [Easypay API.](https://ssl.easypay.by/light/)

```javascript
var Easypay = require('node-easypay');

var easypay = new Easypay('web_key');
```
For tests pass true as second param.
## Functions
Currently SOAP is not implemented.

### Create invoice. Return res object.
```javascript
easypay.createInvoice({
  'EP_MerNo': 'ok1111'
  'EP_OrderNo': '12312412',
  'EP_Sum': 12.50,
  'EP_Expires': 2,
  'EP_Comment': 'Тест',
  'EP_OrderInfo': 'Тест',
  'EP_Success_URL': 'http://mytestshop.by/success/',
  'EP_Cancel_Url': 'http://mytestshop.by/cancel/',
  'EP_Debug': '0'
})
.then(function(res) {
  ...
})
.catch(function(err) {
  ...
})
```

### Create signature. Return signature as string.
```javascript
var signature = easypay.createSignature({
  'EP_OrderNo': '12312412',
  'EP_Sum': 12.50,
  'EP_Expires': 2,
  'EP_Comment': 'Тест',
  'EP_OrderInfo': 'Тест',
  'EP_Success_URL': 'http://mytestshop.by/success/',
  'EP_Cancel_Url': 'http://mytestshop.by/cancel/',
  'EP_Debug': '0'
}, 'secret_key');
```

### Check signature. Return boolean value.
```javascript
easypay.checkSignature(params_from_easypay, 'secret_key');
```

### Parse notification JSON response that contains XML
```javascript
easpay.parseResponse(body)
  .then(function(result) {
    ...
  })
  .catch(function(err) {
    ...
  })
```

## Tests
```bash
npm run test
```
## License
MIT

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