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;
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",
cardnumber:"315432847547022",
cardexpiredatemonth:"05",
cardexpiredateyear:"18",
strCustomeripaddress:"127.0.0.1",
cardcvv2:"139"
},res);
}
var server = require('http').createServer(handleRequest);
server.listen(881, function(){
console.log("Server listening on: http://localhost:%s", 881);
});