Skip to content

SeNaP/node-robokassa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Robokassa merchant for node

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published