garanti-3dpay
v1.0.10
Published
Garanti 3D Payment module for Node.js
Downloads
6
Readme
Garanti 3D-Pay client API
garanti-3dpay is designed to charge credit cards to Garanti bank accounts.
Sample project
var handleRequest = function(req,res){
var garanti = require('garanti-3dpay');
var status = garanti.getStatus(req,function(err,params){
console.log(params);
res.writeHead(200, {"Content-Type":"text/html"});
if (err)
res.end("ERROR");
else
res.end(params);
});
if (status !== undefined)
return; //Handle 3d payment from callback above
//Initiate credit card payment
garanti.init({
strTerminalMerchantID : "XXXXXX",
strTerminalID : "XXXXXXXX",
strOrderID : "XXXXXX",
strProvisionPassword:"XXXXXXX",
strSuccessURL:"http://127.0.0.1:881/success",
strErrorURL:"http://127.0.0.1:881/error",
strStoreKey:"XXXXX", // 3D Store Key
cardnumber:"315432847547022", //Credit Card number
cardexpiredatemonth:"05", // Card month
cardexpiredateyear:"18", // Card Year
strCustomeripaddress:"127.0.0.1", //Customer ip address
cardcvv2:"139"
},res);
}
//Create a server
var server = require('http').createServer(handleRequest);
//Lets start our server
server.listen(881, function(){
//Callback triggered when server is successfully listening. Hurray!
console.log("Server listening on: http://localhost:%s", 881);
});