payflex-pay
v1.0.8
Published
PayFlex is payment API for some banks in Turkey including Isbank, Ziraat and Bank Asya. To use this API, you need to install formidable,request,xml2js libraries
Downloads
8
Maintainers
Readme
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);
});