This is node package for work with robokassa.ru API
$ npm install robokassa
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);
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');
});
- node.js - evented I/O for the backend
- Express - fast node.js network app framework [@tjholowaychuk]
- robokassa.ru - Robokassa API