0.0.7 • Published 7 years ago

pgs v0.0.7

Weekly downloads
30
License
-
Repository
github
Last release
7 years ago

pgs

Payment npm module from MiTec to help chatbots developers to implement a payment gateway

( You will need production credentials to make valid payments, contact us https://www.mitec.com.mx/ )

npm install pgs --save

demo.js

var pgs = require('pgs');
 
try{
	/*Set the endpoint (OPTIONAL) - Use to change between production (default) and sandbox*/
	pgs.setEndpoint("https://sandbox.mit.com.mx/");
	
	/* Cipher config for communication between the app and the gateway (REQUIRED)*/
    pgs.setCipher({
        "id":"0000000001",
        "key":"82A15AEEBFFCCC911F798BB6CFCCE7E2"
    });
	
	/* Your credentials (REQUIRED)*/
	pgs.setBussiness({
        "id_company":"0001",
        "id_branch":"1000",
        "user":"DEMO",
        "pwd":"DEMO01"
    });
 
	/* Description/label of the payment (REQUIRED)*/
    pgs.setReference('AAA123');
	
	/* Amount of the payment (REQUIRED)*/
    pgs.setAmount('25.00');
 
	/*Set debug flag (OPTIONAL), default: false*/
	pgs.setDebug(true);
 
    pgs.callAPI(function(url){
		/* Result URL */
        console.log( url );
    });
} catch (err) {
    console.error("Error:", err );
}
0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago