garanti-3dpay

1.0.10 • Public • Published

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);
 
});

Package Sidebar

Install

npm i garanti-3dpay

Weekly Downloads

3

Version

1.0.10

License

ISC

Last publish

Collaborators

  • alpus