* LightSmsTransport.php - better to remove if we do not have it?

This commit is contained in:
Vasilij Dusko | CREATION 2021-04-01 13:58:54 +03:00
parent 83d259832b
commit a197deeed1

View File

@ -26,14 +26,13 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
*/
final class LightSmsTransport extends AbstractTransport
{
protected const HOST = 'www.lightsms.com';
protected const HOST = 'lightsms.com';
private $login;
private $password;
private $from;
private const ERROR_CODES = [
000 => 'Service unavailable',
1 => 'Missing Signature',
2 => 'Login not specified',
3 => 'Text not specified',
@ -119,6 +118,8 @@ final class LightSmsTransport extends AbstractTransport
$content = $response->toArray(false);
dump($content); die();
// it happens if the host without www
if (isset($content['']) && isset($content['']['error'])) {
throw new TransportException('Unable to send the SMS: '.self::ERROR_CODES[$content['']['error']], $response);