invokatis / sendotp
MSG91 SendOTP服务的API抽象
1.2.2
2019-08-06 12:17 UTC
Requires
- php: ^5.4 || ^7.0
- ext-json: *
- guzzlehttp/guzzle: ^5.0 || ^6.0
README
安装
composer require invokatis/sendotp
用法
<?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.md文件。