Skip to content

Instantly share code, notes, and snippets.

@darilldrems
Created July 21, 2016 17:00
Show Gist options
  • Save darilldrems/c6b16530415685b7438401a40b44a093 to your computer and use it in GitHub Desktop.
Save darilldrems/c6b16530415685b7438401a40b44a093 to your computer and use it in GitHub Desktop.
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 otpClient = pwcClient.getOtp();
//this method will send otp to phone number
otpClient.sendSmsOtp(phone)
.then(function(resp){
// do whatever you want with the response.
// do JSON.stringify the response to see all attributes available
});
//this method will send voice otp to the phone number
otpClient.sendVoiceOtp(phone)
.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