npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-expresspay

v0.0.0

Published

Node module for using Expresspay api.

Downloads

11

Readme

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": '[email protected]',
  "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 |Function |String | |-----------------------|:------------------------:| |createInvoiceERIP |create_invoice_erip | |getInvoicesListERIP |get_invoices_list_erip | |getInvoiceDetailsERIP |get_invoice_details_erip | |getInvoiceStatusERIP |get_invoice_status_erip | |getPaymentsListERIP |get_payments_list_erip | |getPaymentDetailsERIP |get_payment_details | |cancelInvoiceERIP |create_invoice_card | |cancelInvoiceERIP |get_invoice_form_card | |cancelInvoiceERIP |get_invoice_status_card | |cancelInvoiceERIP |reverse_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