Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#SendOTP - PHP SDK
# SendOTP - PHP SDK

This SDK allows you to connect to SendOTP server from your php app. To start off, follow the following guide:

[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.png?v=103)](https://opensource.org/licenses/mit-license.php)

[![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://forthebadge.com)

##Set-up:
## Set-up:

First of all, download the sdk by composer:

Expand All @@ -29,7 +30,7 @@ Once required, the last step is to initialize the SDK with your project name and

That's all, your SDK is set up! You can now use any block by copying the code snippet from the marketplace.

##Usage:
## Usage:

print_r($otp->send('91998153xxxx', 'MSGIND'));

Expand All @@ -43,11 +44,11 @@ The printed result will be:
)


##Issues:
## Issues:

As this is a pre-release version of the SDK, you may expirience bugs. Please report them in the issues section to let us know. You may use the intercom chat on https://msg91.com for support at any time.

##Licence:
## Licence:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
13 changes: 7 additions & 6 deletions src/sendotp/sendotp.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ public function send($contactNumber, $senderId, $otp=null) {
$requestArgs["otp"]=$otp;
$this->message=$requestArgs["message"];
$response = $this->call("sendotp.php", $requestArgs);
if($response["type"]=="success"){
$response["otp"]=$requestArgs["otp"];
}
else{
$response["otp"]="";
}
if (array_key_exists("type",$response)){
if($response["type"]=="success"){
$response["otp"]=$requestArgs["otp"];
}
}else{
$response["otp"]="";
}
return $response;
}

Expand Down