checkotp

Creator: coderz1093

Last updated:

0 purchases

checkotp Image
checkotp Images

Languages

Categories

Add to Cart

Description:

checkotp

checkotp #
Allows users of the Droptxt SMS service in Sri Lanka to run OTP checks on Mobile numbers of users registering for their application.
To use the service, please register by contacting the Droptxt team at [email protected] with a description of your use case.
Once you register, you will be provided with an 'appkey' and a 'passphrase'. You will require these to access the Droptxt OTP API.
Getting Started #
The OTP is validated in 2 steps.

Pass the mobile number that needs to be verified to the makeOTPRequest(mobile, appkey, passphrase) function, all variables to be passed as string values. The mobile number should follow the format 947XXXXXXXX. The method will return a string response:
a. The status of the OTP request will be either ('OTPSent' or 'OTPFailed').
b. In the event of 'OTPFailed', the request can be sent again by calling the makeOTPRequest method.

var checkotp = new CheckOTP();
var otpStatus = "";
otpStatus = checkotp.makeOTPRequest("947XXXXXXXX", dtAppKey, dtPassphrase)
as String;
print(otpStatus);
copied to clipboard

When the user enters the received OTP value, that value should be passed into matchToken(value). The response will be given as "match" for correct validation and "nomatch" if the OTP is incorrect.

var checkotp = new CheckOTP();
var matchMsg = "";

matchMsg =
checkotp.matchToken(otpNum) as String; //output will be 'match' or 'nomatch'
print(matchMsg);
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.