Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev #13

Merged
merged 3 commits into from
Sep 26, 2022
Merged

dev #13

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
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@ array:6 [▼
| DianaHost | api_key, type, senderid | Done | - |
| DianaSMS | ApiKey, ClientId, SenderId | Done | - |
| Esms | api_token, sender_id | Done | - |
| ElitBuzz | api_key, type, senderid | Done | not tested yet in live |
| ElitBuzz | api_key, type, senderid | Done | not tested yet in live |
| Infobip | user, password | Done | not tested yet in live |
| MDL | api_key, type, senderid | Done | not tested yet in live |
| MDL | api_key, type, senderid | Done | not tested yet in live |
| Metronet | api_key, mask | Done | - |
| MimSms | api_key, type, senderid | Done | - |
| Mobireach | Username,Password, From | Done | - |
| NovocomBD | ApiKey , ClientId , SenderId | Done | - |
| OnnoRokomSMS | userName, userPassword, type, maskName, campaignName | Done | not tested yet in live |
| SmartLabSMS | user, password, sender | Done | - |
| Sslsms | api_token, sid, csms_id | Done | - |
| Tense | user, password, campaign, masking | Done | - |
| TwentyFourSmsBD | apiKey, sender_id | Done | - |
Expand Down
6 changes: 6 additions & 0 deletions src/Config/sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use Xenon\LaravelBDSms\Provider\Mobishasra;
use Xenon\LaravelBDSms\Provider\NovocomBd;
use Xenon\LaravelBDSms\Provider\Onnorokom;
use Xenon\LaravelBDSms\Provider\SmartLabSms;
use Xenon\LaravelBDSms\Provider\Sms4BD;
use Xenon\LaravelBDSms\Provider\Ssl;
use Xenon\LaravelBDSms\Provider\Tense;
Expand Down Expand Up @@ -159,6 +160,11 @@
'maskName' => env('SMS_ONNOROKOM_MASK', ''),
'campaignName' => env('SMS_ONNOROKOM_CAMPAIGN_NAME', ''),
],
SmartLabSms::class => [
'user' => env('SMS_SMARTLAB_USER', ''),
'password' => env('SMS_SMARTLAB_PASSWORD', ''),
'sender' => env('SMS_SMARTLAB_SENDER', ''),
],
Sms4BD::class => [
'publickey' => env('SMS_SMS4BD_PUBLIC_KEY', ''),
'privatekey' => env('SMS_SMS4BD_PRIVATE_KEY', ''),
Expand Down
3 changes: 1 addition & 2 deletions src/Provider/Adn.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public function sendRequest()

$data['number'] = $number;
$data['message'] = $text;
$report = $this->generateReport($smsResult, $data);
return $report->getContent();
return $this->generateReport($smsResult, $data)->getContent();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Provider/AjuraTech.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ public function sendRequest()

$requestObject = new Request('https://smpp.ajuratech.com:7790/sendtext?json', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();

$data['number'] = $number;
$data['message'] = $text;
$report = $this->generateReport($smsResult, $data);
return $report->getContent();
return $this->generateReport($smsResult, $data)->getContent();
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/BDBulkSms.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public function sendRequest()
$requestObject = new Request('http://api.greenweb.com.bd/api2.php', $query, $queue);

$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Banglalink.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public function sendRequest()
$requestObject = new Request('https://vas.banglalink.net/sendSMS/sendSMS', [], $queue);
$requestObject->setFormParams($formParams);
$response = $requestObject->post();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/BoomCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public function sendRequest()
$requestObject = new Request('https://api.boom-cast.com/boomcast/WebFramework/boomCastWebService/OTPMessage.php', $query, $queue);

$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Brilliant.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public function sendRequest()

$requestObject = new Request('http://sms.brilliant.com.bd:6005/api/v2/SendSMS', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/BulkSmsBD.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public function sendRequest()

$requestObject = new Request('http://66.45.237.70/api.php', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/DianaHost.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public function sendRequest()

$requestObject = new Request('http://esms.dianahost.com/smsapi', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/DianaSms.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ public function sendRequest()

$requestObject = new Request('https://q.dianasms.com/api/v2/SendSMS', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/ElitBuzz.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ public function sendRequest()
$requestObject = new Request($requestUrl, [], $queue);
$requestObject->setFormParams($formParams);
$response = $requestObject->post(false, 60);
if ($queue)
if ($queue) {
return true;
}


$body = $response->getBody();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Esms.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ public function sendRequest()
$requestObject = new Request('https://login.esms.com.bd/api/v3/sms/send', $query, $queue);
$requestObject->setHeaders($headers)->setContentTypeJson(true);
$response = $requestObject->post();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/GreenWeb.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ public function sendRequest()

$requestObject = new Request('https://api.greenweb.com.bd/api.php?json', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Infobip.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ public function sendRequest()
$requestObject->setHeaders($headers)
->setContentTypeJson(true);
$response = $requestObject->post();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/MDL.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public function sendRequest()

$requestObject = new Request('http://premium.mdlsms.com/smsapi', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Metronet.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public function sendRequest()

$requestObject = new Request('202.164.208.212/smsnet/bulk/api', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/MimSms.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public function sendRequest()

$requestObject = new Request('https://esms.mimsms.com/smsapi', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Mobireach.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ public function sendRequest()

$requestObject = new Request('https://api.mobireach.com.bd/SendTextMessage', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Mobishasra.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ public function sendRequest()
$requestObject = new Request('https://mshastra.com/sendurlcomma.aspx', $query, $queue);

$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}
$body = $response->getBody();
$smsResult = $body->getContents();

Expand Down
3 changes: 2 additions & 1 deletion src/Provider/NovocomBd.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ public function sendRequest()

$requestObject = new Request('https://sms.novocom-bd.com/api/v2/SendSMS', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
1 change: 0 additions & 1 deletion src/Provider/Onnorokom.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function sendRequest()
);
$smsResult = $soapClient->__call("OneToOne", array($paramArray));


return $this->generateReport($smsResult, $data);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Robi.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public function sendRequest()
$requestObject = new Request('https://bmpws.robi.com.bd/ApacheGearWS/SendTextMessage', [], $queue);
$requestObject->setFormParams($formParams);
$response = $requestObject->post();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
80 changes: 80 additions & 0 deletions src/Provider/SmartLabSms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
/*
* Last Modified: 6/29/21, 12:06 AM
* Copyright (c) 2021
* -created by Ariful Islam
* -All Rights Preserved By
* -If you have any query then knock me at
* [email protected]
* See my profile @ https://github.com/arif98741
*/

namespace Xenon\LaravelBDSms\Provider;

use GuzzleHttp\Exception\GuzzleException;
use Xenon\LaravelBDSms\Handler\ParameterException;
use Xenon\LaravelBDSms\Handler\RenderException;
use Xenon\LaravelBDSms\Request;
use Xenon\LaravelBDSms\Sender;

class SmartLabSms extends AbstractProvider
{
/**
* SmartLabSMS constructor.
* @param Sender $sender
*/
public function __construct(Sender $sender)
{
$this->senderObject = $sender;
}

/**
* Send Request To Api and Send Message
* @throws GuzzleException|RenderException
*/
public function sendRequest()
{
$number = $this->senderObject->getMobile();
$text = $this->senderObject->getMessage();
$config = $this->senderObject->getConfig();
$queue = $this->senderObject->getQueue();

$query = [
'user' => $config['user'],
'password' => $config['password'],
'sender' => $config['sender'],
'msisdn' => $number,
'smstext' => $text,
];

$requestObject = new Request('https://labapi.smartlabsms.com/smsapi', $query, $queue);
$response = $requestObject->get();
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();

$data['number'] = $number;
$data['message'] = $text;
return $this->generateReport($smsResult, $data)->getContent();
}

/**
* @throws ParameterException
*/
public function errorException()
{
if (!array_key_exists('user', $this->senderObject->getConfig())) {
throw new ParameterException('user key is absent in configuration');
}
if (!array_key_exists('password', $this->senderObject->getConfig())) {
throw new ParameterException('password key is absent in configuration');
}

if (!array_key_exists('sender', $this->senderObject->getConfig())) {
throw new ParameterException('sender key is absent in configuration');
}
}
}
3 changes: 2 additions & 1 deletion src/Provider/Sms4BD.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public function sendRequest()

$requestObject = new Request('http://www.sms4bd.net', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}
$body = $response->getBody();
$smsResult = $body->getContents();
$data['number'] = $number;
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Ssl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ public function sendRequest()
$requestObject = new Request('https://smsplus.sslwireless.com/api/v3/send-sms', $query, $queue);
}
$response = $requestObject->post();
if ($queue)
if ($queue) {
return true;
}
$body = $response->getBody();
$smsResult = $body->getContents();
$data['number'] = $mobile;
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/Tense.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public function sendRequest()

$requestObject = new Request('http://sms.tense.com.bd/api-sendsms', $query, $queue);
$response = $requestObject->get();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/TwentyFourSmsBD.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public function sendRequest()

$requestObject = new Request('https://24smsbd.com/api/bulkSmsApi', $query, $queue);
$response = $requestObject->post();
if ($queue)
if ($queue) {
return true;
}

$body = $response->getBody();
$smsResult = $body->getContents();
Expand Down
Loading