1.0.8 • Published 8 years ago

payflex-pay v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

PayFlex client API

payflex-pay is designed to charge credit cards to Is Bankasi,Ziraat Banki and Bank Asya accounts.

Sample project

var handleRequest = function(req,res){
    var payflex = require('payflex-pay');
    
    var status = payflex.getStatus(req,function(err,params){
        console.log(params);
        res.writeHead(200, {"Content-Type":"text/html"});
        if (err)
            res.end("ERROR");
        else
            res.end(JSON.stringify(params));
    });
    
    if (status !== undefined)
        return; //Handle 3d payment from callback above 
    
    //Initiate credit card payment 
	var options = {
		MerchantId:"18811938",
		MerchantPassword:"A18811938",
		SuccessURL:"http://127.0.0.1:881/success",
		FailureURL:"http://127.0.0.1:881/error",
		pan:"4012001037141112",
		ExpiryDate:"2011", //YYMM
		SessionInfo:"123", /cvv number
		PurchaseAmount:"100", //1.00 TRY
		Currency:"949", //949 for TRY
		InstallmentCount:"", //Default is 1
		VerifyEnrollmentRequestId:(new Date()).getTime()+""
	};
    payflex.init(options,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);
});
1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago