1.0.0 • Published 3 years ago

mitecwpp v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

pgs

MIT WebPay PLUS card payment npm module for helping developers to implement a payment gateway

To make a real world payment, valid credentials are required. Please contact us at https://www.mitec.com.mx/

npm install mitecwpp --save

demo.js

var mitecwpp = require('mitecwpp');
 
try{
	/*Set the endpoint - Use to change between sandbox (default) and production*/
	mitecwpp.setEndpoint("https://sandboxpo.mit.com.mx/gen");
	
	/* REQUIRED: Cipher config for communication between your server and the gateway */
    mitecwpp.setCipher({
        "id":"0000000001",
        "key":"82A15AEEBFFCCC911F798BB6CFCCE7E2"
    });
	
	/* REQUIRED: Your bussiness identification credentials*/
	mitecwpp.setBussiness({
        "id_company":"0001",
        "id_branch":"1000",
        "user":"DEMO",
        "pwd":"DEMO01"
    });
 
	/* REQUIRED: Unique/unrepeatable merchant reference to reconcile a payment with your business logic. Invoice or order number is suggested. */
    mitecwpp.setReference('AAA123');
	
	/* Amount of the payment (REQUIRED)*/
    mitecwpp.setAmount('25.00');
 
	/*Set debug flag (OPTIONAL), default: false*/
	mitecwpp.setDebug(true);
 
    mitecwpp.callAPI(function(url){
		/* Result URL */
        console.log( url );
    });
} catch (err) {
    console.error("Error:", err );
}
1.0.0

3 years ago