Skip to content

Commit 1879b8a

Browse files
authored
Merge pull request #56 from SimpleSoftwareIO/develop
3.1.0
2 parents c98ac86 + ae14387 commit 1879b8a

30 files changed

Lines changed: 587 additions & 127 deletions

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
language: php
22
sudo: false
33
php:
4-
- 5.6
54
- 7.0
6-
- hhvm
5+
- 7.1
76

87
before_script:
98
- composer install --dev

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 Simple Software LLC www.simplesoftware.io
3+
Copyright (c) 2014-2016 Simple Software LLC www.simplesoftware.io
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Simple SMS
88
[![Total Downloads](https://poser.pugx.org/simplesoftwareio/simple-sms/downloads.svg)](https://packagist.org/packages/simplesoftwareio/simple-sms)
99

1010
## Introduction
11-
Simple SMS is an easy to use package for [Laravel](http://laravel.com/) that adds the capability to send and receive SMS/MMS messages to mobile phones from your web app. It currently supports a free way to send SMS messages through E-Mail gateways provided by the wireless carriers. The package also supports 9 paid services, [Call Fire,](https://www.callfire.com/) [EZTexting,](https://www.eztexting.com) [FlowRoute,](https://www.flowroute.com/) [LabsMobile,](http://www.labsmobile.com) [Mozeo,](https://www.mozeo.com/) [Nexmo,](https://www.nexmo.com/) [Plivo,](https://www.plivo.com/) [Twilio,](https://www.twilio.com) and [Zenvia.](http://www.zenvia.com.br/)
11+
Simple SMS is an easy to use package for [Laravel](http://laravel.com/) that adds the capability to send and receive SMS/MMS messages to mobile phones from your web app. It currently supports a free way to send SMS messages through E-Mail gateways provided by the wireless carriers. The package also supports 9 paid services, [Call Fire,](https://www.callfire.com/) [EZTexting,](https://www.eztexting.com) [FlowRoute,](https://www.flowroute.com/) [LabsMobile,](http://www.labsmobile.com) [Mozeo,](https://www.mozeo.com/) [Nexmo,](https://www.nexmo.com/) [Plivo,](https://www.plivo.com/) [Twilio,](https://www.twilio.com) [Zenvia,](http://www.zenvia.com.br/) and [JustSend.](http://www.justsend.pl/)
1212

1313
## Official Documentation
1414

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.5.0",
14+
"php": ">=7.0.0",
1515
"illuminate/mail": ">=5.0.0",
1616
"illuminate/log": ">=5.0.0",
1717
"illuminate/queue": ">=5.0.0",

docs/en/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Simple SMS is an easy to use package for [Laravel](http://laravel.com/) that add
2525
* [Plivo Driver](#docs-plivo-driver)
2626
* [Twilio Driver](#docs-twilio-driver)
2727
* [Zenvia Driver](#docs-zenvia-driver)
28+
* [JustSend Driver](#docs-justsend-driver)
2829
* [Driver Support](#docs-driver-support)
2930
* [Usage](#docs-usage)
3031
* [Outgoing Message Enclosure](#docs-outgoing-enclosure)
@@ -123,6 +124,7 @@ The following are currently supported by using the e-mail gateway driver.
123124
| USA | Verizon Wireless | verizonwireless | Yes | Yes |
124125
| USA | Virgin Mobile | virginmobile | Yes | Yes |
125126
| USA | T-Mobile | tmobile | Yes | Yes |
127+
| USA | Sprint | sprint | Yes | Yes |
126128

127129
>You must know the wireless provider for the mobile phone to use this driver.
128130
@@ -270,6 +272,24 @@ This driver sends messages through the [Zenvia](http://www.zenvia.com.br/ messag
270272
]
271273
];
272274

275+
<a id="docs-justsend-driver"></a>
276+
###### JustSend Driver
277+
278+
This driver sends messages through the [JustSend](https://justsend.pl/) messaging service which is only avaliable in Poland.
279+
280+
return [
281+
'driver' => 'justsend',
282+
'from' => 'From text',
283+
'justsend' => [
284+
'api_key' => 'Your API Key.'
285+
]
286+
];
287+
288+
`from` can be one of the following:
289+
- `ECO` - cheapest type (about 0.03 PLN per SMS). SMS will be send from random short-code number.
290+
- One of: `INFO`, `INFORMACJA`, `KONKURS`, `NOWOSC`, `OFERTA`, `OKAZJA`, `PROMOCJA`, `SMS` - about 0.06 PLN per SMS.
291+
- Any other text (can not be only number) - about 0.07 PLN per SMS.
292+
273293
<a id="docs-infobip-driver"></a>
274294

275295
<a id="docs-driver-support"></a>
@@ -290,6 +310,7 @@ Not all drivers support every method due to the differences in each individual A
290310
| Plivo | Yes | Yes | Yes | Yes | Yes |
291311
| Twilio | Yes | Yes | Yes | Yes | Yes |
292312
| Zenvia | Yes | Yes | Yes | Yes | Yes |
313+
| JustSend | Yes | Yes | No | No | No |
293314

294315
<a id="docs-usage"></a>
295316
## Usage

src/DoesNotReceive.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace SimpleSoftwareIO\SMS;
34

45
trait DoesNotReceive
@@ -21,7 +22,6 @@ public function checkMessages(array $options = [])
2122
* @param string|int $messageId
2223
*
2324
* @throws \RuntimeException
24-
*
2525
*/
2626
public function getMessage($messageId)
2727
{

src/DriverManager.php

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<?php
2+
23
namespace SimpleSoftwareIO\SMS;
34

45
use GuzzleHttp\Client;
56
use Illuminate\Support\Manager;
6-
use SimpleSoftwareIO\SMS\Drivers\LogSMS;
7+
use SimpleSoftwareIO\SMS\Drivers\CallFireSMS;
78
use SimpleSoftwareIO\SMS\Drivers\EmailSMS;
9+
use SimpleSoftwareIO\SMS\Drivers\EZTextingSMS;
10+
use SimpleSoftwareIO\SMS\Drivers\FlowrouteSMS;
11+
use SimpleSoftwareIO\SMS\Drivers\JustSendSMS;
12+
use SimpleSoftwareIO\SMS\Drivers\LabsMobileSMS;
13+
use SimpleSoftwareIO\SMS\Drivers\LogSMS;
814
use SimpleSoftwareIO\SMS\Drivers\MozeoSMS;
915
use SimpleSoftwareIO\SMS\Drivers\NexmoSMS;
1016
use SimpleSoftwareIO\SMS\Drivers\PlivoSMS;
17+
use SimpleSoftwareIO\SMS\Drivers\SMS77;
1118
use SimpleSoftwareIO\SMS\Drivers\TwilioSMS;
1219
use SimpleSoftwareIO\SMS\Drivers\ZenviaSMS;
13-
use SimpleSoftwareIO\SMS\Drivers\CallFireSMS;
14-
use SimpleSoftwareIO\SMS\Drivers\EZTextingSMS;
15-
use SimpleSoftwareIO\SMS\Drivers\FlowrouteSMS;
16-
use SimpleSoftwareIO\SMS\Drivers\LabsMobileSMS;
1720

1821
class DriverManager extends Manager
1922
{
@@ -59,7 +62,7 @@ protected function createCallfireDriver()
5962
$config = $this->app['config']->get('sms.callfire', []);
6063

6164
$provider = new CallFireSMS(
62-
new Client,
65+
new Client(),
6366
$config['app_login'],
6467
$config['app_password']
6568
);
@@ -91,7 +94,7 @@ protected function createEztextingDriver()
9194
$provider = new EZTextingSMS(new Client());
9295

9396
$data = [
94-
'User' => $config['username'],
97+
'User' => $config['username'],
9598
'Password' => $config['password'],
9699
];
97100

@@ -134,8 +137,8 @@ protected function createMozeoDriver()
134137

135138
$auth = [
136139
'companykey' => $config['company_key'],
137-
'username' => $config['username'],
138-
'password' => $config['password'],
140+
'username' => $config['username'],
141+
'password' => $config['password'],
139142
];
140143
$provider->buildBody($auth);
141144

@@ -177,11 +180,11 @@ protected function createTwilioDriver()
177180
);
178181
}
179182

180-
/**
181-
* Create an instance of the Zenvia driver.
182-
*
183-
* @return ZenviaSMS
184-
*/
183+
/**
184+
* Create an instance of the Zenvia driver.
185+
*
186+
* @return ZenviaSMS
187+
*/
185188
protected function createZenviaDriver()
186189
{
187190
$config = $this->app['config']->get('sms.zenvia', []);
@@ -214,7 +217,7 @@ protected function createPlivoDriver()
214217
}
215218

216219
/**
217-
* Create an instance of the flowroute driver
220+
* Create an instance of the flowroute driver.
218221
*
219222
* @return FlowrouteSMS
220223
*/
@@ -223,11 +226,46 @@ protected function createFlowrouteDriver()
223226
$config = $this->app['config']->get('sms.flowroute', []);
224227

225228
$provider = new FlowrouteSMS(
226-
new Client,
229+
new Client(),
227230
$config['access_key'],
228231
$config['secret_key']
229232
);
230233

231234
return $provider;
232235
}
236+
237+
/**
238+
* Create an instance of the SMS77 driver.
239+
*
240+
* @return SMS77
241+
*/
242+
protected function createSms77Driver()
243+
{
244+
$config = $this->app['config']->get('sms.sms77', []);
245+
246+
$provider = new SMS77(
247+
new Client(),
248+
$config['user'],
249+
$config['api_key'],
250+
$config['debug']
251+
);
252+
253+
return $provider;
254+
}
255+
256+
/**
257+
* Create an instance of the justsend driver.
258+
*
259+
* @return JustSendSMS
260+
*/
261+
protected function createJustSendDriver()
262+
{
263+
$config = $this->app['config']->get('sms.justsend', []);
264+
265+
$provider = new JustSendSMS(
266+
$config['api_key']
267+
);
268+
269+
return $provider;
270+
}
233271
}

src/Drivers/AbstractSMS.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
<?php
2+
23
namespace SimpleSoftwareIO\SMS\Drivers;
34

45
use SimpleSoftwareIO\SMS\IncomingMessage;
56
use SimpleSoftwareIO\SMS\SMSNotSentException;
67

78
abstract class AbstractSMS
89
{
10+
11+
protected $debug;
12+
913
/**
10-
* Throw a not sent exception
14+
* Throw a not sent exception.
15+
*
16+
* @param string $message
17+
* @param null|int $code
1118
*
12-
* @param string $message
13-
* @param null|integer $code
1419
* @throws SMSNotSentException
1520
*/
1621
protected function throwNotSentException($message, $code = null)
@@ -65,4 +70,16 @@ protected function makeMessage($rawMessage)
6570
* @return mixed
6671
*/
6772
abstract protected function processReceive($rawMessage);
73+
74+
/**
75+
* Defines if debug is enabled or disabled (SMS77)
76+
*
77+
* @param $debug
78+
*/
79+
public function setDebug($debug)
80+
{
81+
$this->debug = $debug;
82+
}
83+
84+
6885
}

src/Drivers/CallFireSMS.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace SimpleSoftwareIO\SMS\Drivers;
34

45
use GuzzleHttp\Client;
@@ -48,7 +49,7 @@ public function send(OutgoingMessage $message)
4849
$numbers = implode(',', $message->getTo());
4950

5051
$data = [
51-
'To' => $numbers,
52+
'To' => $numbers,
5253
'Message' => $composeMessage,
5354
];
5455

@@ -112,9 +113,9 @@ public function getMessage($messageId)
112113
*
113114
* @param mixed $raw
114115
*
115-
* @return \SimpleSoftwareIO\SMS\IncomingMessage
116-
*
117116
* @throws \RuntimeException
117+
*
118+
* @return \SimpleSoftwareIO\SMS\IncomingMessage
118119
*/
119120
public function receive($raw)
120121
{

src/Drivers/DriverInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace SimpleSoftwareIO\SMS\Drivers;
34

45
use SimpleSoftwareIO\SMS\OutgoingMessage;

0 commit comments

Comments
 (0)