robokassa

0.0.4 • Public • Published

Node - Robokassa

This is node package for work with robokassa.ru API

Installation

$ npm install robokassa

Usage:

var Robokassa = require('robokassa');
var  r = new Robokassa({login: "login", password: "pa$$w0rd"});
/*
* generate merchat link
* return https://auth.robokassa.ru/Merchant/Index.aspx?MrchLogin=.... .... .....
*/
r.merchantUrl({ id: "invoice number", summ: 500, description: "description of invoice"});
/*
* check payment 
* return true if success else return false
*/
r.checkPayment(req.params);

Example for express:

var Robokassa = require('robokassa');
var  r = new Robokassa({login: "login", password: "pa$$w0rd"});
 
express.get('/', function (req, res){
    link = r.merchantUrl({ id: "invoice number", summ: 500, description: "description"});
    res.render('index', { paymentLink: link});
});
 
 
express.get('/payment/result', function (req, res){
    if(r.checkPayment(req.params)){
        console.log("PAYMENT SUCCESS!");
    }else{
     console.log("PAYMENT NOT SUCCESS!");
    }
});
 
express.get('/payment/true', function (req, res){
    res.render('payment_true');
});
 
express.get('/payment/false', function (req, res){
    res.render('payment_false');
});

links

  • node.js - evented I/O for the backend
  • Express - fast node.js network app framework [@tjholowaychuk]
  • robokassa.ru - Robokassa API

Readme

Keywords

none

Package Sidebar

Install

npm i robokassa

Weekly Downloads

1

Version

0.0.4

License

none

Last publish

Collaborators

  • senap