A PHP SDK for the GlobalSmartOTP API.

Overview

gsOTP

GlobalSmartOTP PHP SDK

A PHP SDK for the GlobalSmartOTP API.

Requirements

  • PHP 7.4 or higher
  • cURL

Installation

$ git clone [email protected]:GlobalSmartOTP/php-lib.git
$ cd php-lib/
$ composer dumpautoload

Send SMS OTP

sendSMS($mobile, $templateID); if (!$referenceID) { echo "Error code: " . $gsOtp->getErrorCode() . PHP_EOL; echo "Error message" . $gsOtp->getErrorMessage() . PHP_EOL; } else { echo "ReferenceID: {$referenceID}"; } ">
require dirname(__FILE__) . '/../vendor/autoload.php';
use GlobalSmartOTP\Api\OTPHandler;
// Get apiKey from https://gsotp.com/dashboard/document/
$apiKey = "";
$mobile = "";
$templateID = 3;
$gsOtp = new OTPHandler($apiKey);
// Send SMS OTP
$referenceID = $gsOtp->sendSMS($mobile, $templateID);
if (!$referenceID) {
    echo "Error code: " . $gsOtp->getErrorCode() . PHP_EOL;
    echo "Error message" . $gsOtp->getErrorMessage() . PHP_EOL;
} else {
    echo "ReferenceID: {$referenceID}";
}

Verify OTP

verify($mobile, $otp); if (!$verified) { echo "Error code: " . $gsOtp->getErrorCode() . PHP_EOL; echo "Error message" . $gsOtp->getErrorMessage() . PHP_EOL; } else { echo "Verified OTP!"; } ">
require dirname(__FILE__) . '/../vendor/autoload.php';
use GlobalSmartOtp\Api\OTPHandler;
// Get apiKey from https://gsotp.com/dashboard/document/
$apiKey = "";
$mobile = "";
$otp = 0;
$gsOtp = new OTPHandler($apiKey);
// Verify OTP
$verified = $gsOtp->verify($mobile, $otp);
if (!$verified) {
    echo "Error code: " . $gsOtp->getErrorCode() . PHP_EOL;
    echo "Error message" . $gsOtp->getErrorMessage() . PHP_EOL;
} else {
    echo "Verified OTP!";
}

License

MIT

You might also like...
Fatture in Cloud SDK (Software Development Kit) for PHP

FattureInCloud PHP SDK Request informations In every request description you will be able to find some additional informations about context, permissi

Explicador e2Payments PHP SDK
Explicador e2Payments PHP SDK

This package seeks to help php developers implement the e2Payments APIs without much hustle. It is based on the REST API whose documentation

Laravel wrapper for the Facebook Graph PHP 8 SDK

Laravel Facebook Graph SDK Installation Getting started with Laravel Facebook Graph is easy - first, install the package via composer composer require

OneSignal PHP SDK

OneSignal SDK for PHP developers with fluent API and supports Laravel / Lumen out of the box.

2c2p payment gateway Redirect PHP-SDK
2c2p payment gateway Redirect PHP-SDK

2c2p payment gateway Redirect PHP-SDK

可能是基于 hyperf 的最优雅的支付宝、微信支付 SDK 了
可能是基于 hyperf 的最优雅的支付宝、微信支付 SDK 了

当前组件整体处于 beta 阶段 运行环境 php = 7.3 composer hyperf = 2.1 安装 composer require yansongda/hyperf-pay:~1.0.0 说明 发布配置文件 php bin/hyperf.php vendor:publish ya

Laravel SDK for Sentry
Laravel SDK for Sentry

Sentry for Laravel Laravel integration for Sentry. Laravel Version Compatibility Laravel = 4.2.x is supported until 0.8.x Laravel = 5.7.x on PHP =

Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

Releases(v2.1.0)
Owner
GlobalSmartOTP
GlobalSmartOTP
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Telegram Bot API - PHP SDK Telegram Bot PHP SDK lets you develop Telegram Bots in PHP easily! Supports Laravel out of the box. Telegram Bot API is an

Irfaq Syed 2.5k Jan 6, 2023
Official PHP SDK for interacting with the Knock API.

Knock PHP library Documentation See the documentation for PHP usage examples

Knock 4 Dec 16, 2022
SDK for latest version of Telegram bots API

SDK for latest version of Telegram bots API (from April 24, 2020) Using Examples Installing composer require "DiyorbekUz/Telelib: dev-master" Init bot

Diyorbek 2 Sep 5, 2021
Universal payments API SDK (UNOFFICIAL QIWI CLIENT)

Qiwi Php Client Especially for ?? Zorra Telecom and ?? Everyone else Привет Attention: At the moment the number of methods is very limited, they will

Ivan Terentev 2 Oct 25, 2022
It's a PHP Application to simplify working with Google Sheets SDK for php.

About GoogleSheetsPHP It's a PHP Application to simplify working with Google Sheets SDK for php. Note: i used Slim 3 to construct the application but

Sami Alateya 5 Dec 20, 2022
Official repository of the AWS SDK for PHP (@awsforphp)

AWS SDK for PHP - Version 3 The AWS SDK for PHP makes it easy for developers to access Amazon Web Services in their PHP code, and build robust applica

Amazon Web Services 5.7k Jan 1, 2023
Mailgun's Official SDK for PHP

Mailgun PHP client This is the Mailgun PHP SDK. This SDK contains methods for easily interacting with the Mailgun API. Below are examples to get you s

Mailgun Team 1k Dec 23, 2022
A Laravel package to help integrate Shopware PHP SDK much more easier

Shopware 6 Laravel SDK A Laravel package to help integrate Shopware PHP SDK much more easier Installation Install with Composer composer require sas/s

Shape & Shift 16 Nov 3, 2022
Minter Blockchain PHP SDK

About This is a pure PHP SDK for working with Minter blockchain Installation Minter Api Methods: getBalance getNonce send getAddresses getStatus getVa

Minter 24 Nov 21, 2022
The official PHP SDK for Webmarketer (app.webmarketer.io)

PHP SDK for Webmarketer The official PHP SDK for Webmarketer (app.webmarketer.io). Install To add this package, your project must meet several require

Webmarketer 5 Dec 13, 2021