Skip to content

vaibhavpandeyvpz/sendotp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

invokatis/sendotp

API abstraction for SendOTP service by MSG91.

Latest Version Downloads PHP Version License

SensioLabsInsight

Install

composer require invokatis/sendotp

Usage

<?php

/**
 * @desc Create a SendOTP\Client with your auth key.
 */
$client = new SendOTP\Client('<auth-key>');

/**
 * @desc Send and retrieve whether successful or not.
 */
$sent = $client->generate('9876543210', '91');

/**
 * @desc Verify an OTP entered by user.
 */
$ok = $client->verify($_POST['otp'], '9876543210', '91');
if ($ok) {
    // OTP verified successfully!
}

License

See LICENSE.md file.