2.0.2 • Published 7 years ago

unitpay v2.0.2

Weekly downloads
20
License
MIT
Repository
github
Last release
7 years ago

Unitpay

Module for checking and forming order for payment service UnitPay.ru

Installation

npm install unitpay

Using

const UnitPay = require('unitpay');

var u = new UnitPay({
    secretKey: 'SECRET',
    publicKey: 'PUBLIC_KEY'
});

// Generate merchat link
let price = 10;
let orderId = 'SE-123Q-WE412';
let description = 'Awsome product';

// return
// https://unitpay.ru/pay/PUBLIC_KEY?account=SE-123Q-WE412&currency=RUB&desc=Awsome%20product&sum=10&signature=d3f05773a162c0f7f9e572b73eaec8d19918b8ffda6ab08aaf90154f6c46e8ba&locale=ru
let payLink = u.form(price, orderId, description);

API

UnitPay.form(sum, account, desc, currency = 'RUB', locale = 'ru')

Description: Get URL for pay through the form Return: {String}

Arguments:

  • {Number}: sum - Payment sum
  • {String}: account - Unique service order id
  • {String}: currency - Payment currecncy
  • {String}: locale - Payment form language interface

UnitPay.api(method, params = {}, callback)

Description: Call API Return: {Promise}

Arguments:

  • {String}: method - API menthod name
  • {Object}: params - method parameters
  • {Function}: callback - callback function
2.0.2

7 years ago

2.0.0

7 years ago

1.0.0

8 years ago