Created
July 21, 2016 17:55
-
-
Save darilldrems/cd1d82766c3c7aae3451e3114aa5b86a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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