- Obtain API Key from https://www.authpin.com
- Include authpin.class.php in your script.
- Check example.php for basic usage.
Include authpinclass.php class and create object
$api = "";
require_once(authpin.class.php);
$authpin = new AuthPin($api);
// Returns the QR code. Your user can scan this QR using AuthPin app / Website.
$email = "[email protected]";
echo $authpin->register($email);
$pin = "1234";
if($authpin->verify($pin,$email))
{
echo "Valid Pin";
}
else
{
echo "Invalid Pin";
}
// Send OTP to phone
// Hash will be returned after OTP send . You need to pass the hash to verify the SMS
$phone="9xxxxxxxxx";
$country = "IN";
$hash = $authpin->sendOTP($phone,$county);
$smscode = "1234";
if($authpin->verifyotp( $smscode , $hash))
{
echo "Valid OTP";
}
else
{
echo "Invalid OTP";
}