payflex-pay

1.0.8 • Public • Published

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

Package Sidebar

Install

npm i payflex-pay

Weekly Downloads

1

Version

1.0.8

License

ISC

Last publish

Collaborators

  • alpus