Skip to content

Instantly share code, notes, and snippets.

@darilldrems
Created July 21, 2016 17:55
Show Gist options
  • Select an option

  • Save darilldrems/cd1d82766c3c7aae3451e3114aa5b86a to your computer and use it in GitHub Desktop.

Select an option

Save darilldrems/cd1d82766c3c7aae3451e3114aa5b86a to your computer and use it in GitHub Desktop.
var PayWithCaptureClient = require('PayWithCapture');
var clientId = "", //Your client id is in devcenter account page
clientSecret = "", //Your clientSecret is in devcenter account page
env = "staging"; //can be staging or production
var client = new PayWithCaptureClient(clientId, clientSecret, env);
var qrClient = client.getQrCode();
data = {
"merchant_id": "",
"name": "",
"description": "",
"amount_locked": "",
"image": ""
};
//this will generate the QR code for you
qrClient.generateQrCode(data)
.then(function(resp) {
//you can do JSON.stringify to inspect the response from the server
});
//this will fetch product qr code for you
qrClient.fetchProductQrCode(data)
.then(function(resp) {
//you can do JSON.stringify to inspect the response from the server
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment