Created
July 21, 2016 16:43
-
-
Save darilldrems/be07d890505b38221743d20160a80d47 to your computer and use it in GitHub Desktop.
PwC pos printing example in javascript for Nodejs server application.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PayWithCapture = require('PayWithCapture'); | |
var clientId = "eyet636484u4h", //Your clientId is in your PayWithCapture DevCenter account page | |
clientSecret = "736484yekhgutit857485", //Your clientSecret is in your PayWithCapture DevCenter account page | |
env = "staging"; // env can either be staging or production | |
var pwcClient = new PayWithCapture(clientId, clientSecret, env); | |
var posClient = pwcClient.getPosPrinting(); | |
var merchantCode = "474649"; //You merchant code is in your account page on PayWithCapture DevCenter | |
//this method will return transactions done by a merchant | |
posClient.printFromMerchantCode(merchantCode) | |
.then(function(resp){ | |
// do whatever you want with the response. | |
// do JSON.stringify the response to see all attributes available | |
}); | |
var ref = ""; | |
//this method will return details of a transaction with the supplied reference no | |
posClient.printFromReferenceNo(ref) | |
.then(function(resp){ | |
// do whatever you want with the response. | |
// do JSON.stringify the response to see all attributes available | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment