1 | <?php |
||
8 | class ZonerSmsGateway |
||
9 | { |
||
10 | /** @var HttpClient HTTP Client */ |
||
11 | protected $http; |
||
12 | |||
13 | /** @var string|null Zoner SMS-API username. */ |
||
14 | protected $username = null; |
||
15 | |||
16 | /** @var string|null Zoner SMS-API password. */ |
||
17 | protected $password = null; |
||
18 | |||
19 | /** @var string|null Default sender number or text. */ |
||
20 | protected $sender = null; |
||
21 | |||
22 | /** |
||
23 | * @param string|null $username |
||
24 | * @param string|null $password |
||
25 | * @param string|null $sender sender number or name |
||
26 | * @param HttpClient|null $httpClient |
||
27 | */ |
||
28 | 10 | public function __construct($username, $password, $sender = null, HttpClient $httpClient = null) |
|
36 | |||
37 | /** |
||
38 | * Gets the HttpClient. |
||
39 | * |
||
40 | * @return HttpClient |
||
41 | */ |
||
42 | 10 | protected function httpClient() |
|
46 | |||
47 | /** |
||
48 | * Sends a message via the gateway. |
||
49 | * |
||
50 | * @param string $receiver phone number where to send (for example "35840123456") |
||
51 | * @param string $message message to send (UTF-8, but this function converts it to ISO-8859-15) |
||
52 | * @param string|null $sender sender phone number (for example "35840123456") |
||
53 | * or string (max 11 chars, a-ZA-Z0-9) |
||
54 | * |
||
55 | * @return tracking number |
||
56 | * |
||
57 | * @throws CouldNotSendNotification if sending failed. |
||
58 | */ |
||
59 | 10 | public function sendMessage($receiver, $message, $sender = null) |
|
105 | } |
||
106 |