node-yandex-kassa
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "node-yandex-kassa", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Node.js utilities to integrate Yandex.Kassa with your app", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,2 +0,6 @@ | ||
## node-yandex-kassa | ||
#node-yandex-kassa | ||
--- | ||
[![NPM Version](https://img.shields.io/npm/v/node-yandex-kassa.svg?style=flat)](https://www.npmjs.com/package/node-yandex-kassa) | ||
[![Build Status](https://img.shields.io/travis/ZeroOneStudio/node-yandex-kassa/master.svg?style=flat)](https://travis-ci.org/ZeroOneStudio/node-yandex-kassa) | ||
by [Zero One](http://www.zeroone.st) | ||
@@ -6,2 +10,10 @@ | ||
## Installation | ||
``` | ||
npm install --save node-yandex-kassa | ||
``` | ||
## Usage | ||
Example usage with Express in route handler: | ||
@@ -11,3 +23,3 @@ | ||
import { checkMD5, buildResponse } from 'node-yandex-kassa'; | ||
const { KASSA_SHOP_ID } = process.env; // ... if you store such things there | ||
const { KASSA_SHOP_PASSWORD } = process.env; // ... if you store such things there | ||
@@ -18,3 +30,3 @@ app.post('/payments/check_order', (req, res, next) => { | ||
if (!checkMD5(body, KASSA_SHOP_ID)) { | ||
if (!checkMD5(body, KASSA_SHOP_PASSWORD)) { | ||
return res.status(400).send('Validation of MD5 failed'); | ||
@@ -37,3 +49,3 @@ } | ||
## checkMD5(requestBody, shopId) | ||
## checkMD5(requestBody, shopPassword) | ||
@@ -44,4 +56,2 @@ Returns `boolean`. | ||
`shopId` is given by Yandex.Kassa during registration. | ||
Requests are being made by Yandex.Kassa service and have standart format (with sample data): | ||
@@ -48,0 +58,0 @@ |
10526
12
109