Socket
Socket
Sign inDemoInstall

node-expresspay

Package Overview
Dependencies
48
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-expresspay

Node module for using Expresspay api.


Version published
Maintainers
1
Created

Readme

Source

node-expresspay

Node module for using Expresspay API.

var Expresspay = require('node-expresspay');

var expresspay = new Expresspay('https://api.express-pay.by/v1/', 'API-Key', 'Secret-Key', 'Return-Secret-Key');

ERIP functions

Signature included.

Create invoice

expresspay.createInvoiceERIP({
  "AccountNo": 10, // required
  "Amount": 10, // required
  "Currency": 933, // required
  "Expiration": '20171210',
  "Info": 'info',
  "Surname": 'Ivanov',
  "FirstName": 'Ivan',
  "Patronymic": 'Ivanovich',
  "City": 'Minsk',
  "Street": 'Karl Marks',
  "House": '2a',
  "Building": '2',
  "Apartment": '34',
  "IsNameEditable": 1,
  "IsAddressEditable": 1,
  "IsAmountEditable": 1,
  "EmailNotifacation": 'ivanovivan@gmail.com',
  "SmsPhone": '+375291111111'
})
.then(function(res) {
  console.log(res.InvoiceNo);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Get invoices list by params

expresspay.getInvoicesListERIP({
  "From": '20170110',
  "To": '20171210',
  "AccountNo": 100,
  "Status": 1 
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Get invoice details

expresspay.getInvoiceDetailsERIP({ 
  "InvoiceNo": 10 // required
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Get invoice status

expresspay.getInvoiceStatusERIP({
  "InvoiceNo": 10 // required
})
.then(function(res) {
  console.log(res)
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Get payments list

expresspay.getPaymentsListERIP({
  "From": '20170110',
  "To": '20171210',
  "AccountNo": 100
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Get payment details

expresspay.getPaymentDetailsERIP({
  "PaymentNo": 2 // required
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Cancel invoice

expresspay.cancelInvoiceERIP({
  "InvoiceNo": 10 // required
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg)
})

Card functions

Signature included.

Create invoice

expresspay.createInvoiceCard({
  "AccountNo": "123456", // required
  "Expiration": "20161224", // required
  "Amount": 10, // required
  "Currency": 933, // required
  "Info": 'info', // required
  "ReturnUrl": 'https://example.com/success', // required 
  "FailUrl": 'https://example.com/fail', // required
  "Language": 'ru',
  "SessionTimeoutSecs": 2000,
  "ExpirationDate": '20161224235001'
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Get invoice form

expresspay.getInvoiceFormCard({
  "InvoiceId": 100 // required
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg)
})

Get invoice status

expresspay.getInvoiceStatusCard({
  "InvoiceId": 100, // required 
  "Language": 'ru'
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Reverse invoice

expresspay.reverseInvoiceCard({
  "InvoiceId": 100 // required
})
.then(function(res) {
  console.log(res);
})
.catch(function(e) {
  throw new Error(e.Error.Msg);
})

Signature functions

Create signature

Return signtaure as string.

expresspay.createSignature(type, data)
var signature = expresspay.createSignature('create_invoice_erip',
{
  "AccountNo": 26,
  "Amount": '10',
  "Currency": '933',
  "Info": 'testtest',
  "ReturnUrl": 'https://example.com/success',
  "FailUrl": 'https://example.com/fail',
});

Types

FunctionString
createInvoiceERIPcreate_invoice_erip
getInvoicesListERIPget_invoices_list_erip
getInvoiceDetailsERIPget_invoice_details_erip
getInvoiceStatusERIPget_invoice_status_erip
getPaymentsListERIPget_payments_list_erip
getPaymentDetailsERIPget_payment_details
cancelInvoiceERIPcreate_invoice_card
cancelInvoiceERIPget_invoice_form_card
cancelInvoiceERIPget_invoice_status_card
cancelInvoiceERIPreverse_invoice_card

Check signature

Return true or false

expresspay.checkSignature(data, signature);
var check = expresspay.checkSignature('{"CmdType":1,"AccountNo":"123456789","PaymentNo":123,"Amount":"100000","Created":"20171121162605","Service":"Ремонт бытовой техники","Payer":"Иванов Петр Анатольевич","Address":"г. Минск, ул. Автозаводская, д.1, кв. 65"}', '7307D720623523CABB3C291AB1D9A683FFB711BB');

Tests

npm run eriptest
npm run cardtest
npm run checktest

License

MIT

Keywords

FAQs

Last updated on 21 Nov 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc