diff options
Diffstat (limited to 'lib/Service/Gateway')
-rw-r--r-- | lib/Service/Gateway/SMS/Provider/Ovh.php | 14 | ||||
-rw-r--r-- | lib/Service/Gateway/SMS/Provider/SipGate.php | 9 | ||||
-rw-r--r-- | lib/Service/Gateway/SMS/Provider/SipGateConfig.php | 2 |
3 files changed, 12 insertions, 13 deletions
diff --git a/lib/Service/Gateway/SMS/Provider/Ovh.php b/lib/Service/Gateway/SMS/Provider/Ovh.php index 4149f72..68dca01 100644 --- a/lib/Service/Gateway/SMS/Provider/Ovh.php +++ b/lib/Service/Gateway/SMS/Provider/Ovh.php @@ -95,11 +95,11 @@ class Ovh implements IProvider { $this->getTimeDelta(); - $header = $this->getHeader('GET',$this->attrs['endpoint'].'/sms'); - $response = $this->client->get($this->attrs['endpoint'].'/sms',[ + $header = $this->getHeader('GET', $this->attrs['endpoint'].'/sms'); + $response = $this->client->get($this->attrs['endpoint'].'/sms', [ 'headers' => $header, ]); - $smsServices = json_decode($response->getBody(),true); + $smsServices = json_decode($response->getBody(), true); $smsAccountFound = false; foreach ($smsServices as $smsService) { @@ -123,12 +123,12 @@ class Ovh implements IProvider { ]; $body = json_encode($content); - $header = $this->getHeader('POST',$this->attrs['endpoint']."/sms/$smsAccount/jobs",$body); - $response = $this->client->post($this->attrs['endpoint']."/sms/$smsAccount/jobs",[ + $header = $this->getHeader('POST', $this->attrs['endpoint']."/sms/$smsAccount/jobs", $body); + $response = $this->client->post($this->attrs['endpoint']."/sms/$smsAccount/jobs", [ 'headers' => $header, 'json' => $content, ]); - $resultPostJob = json_decode($response->getBody(),true); + $resultPostJob = json_decode($response->getBody(), true); if (count($resultPostJob["validReceivers"]) === 0) { throw new SmsTransmissionException("Bad receiver $identifier"); @@ -168,7 +168,7 @@ class Ovh implements IProvider { * @param string $body JSON encoded body content for the POST request * @return array $header Contains the data for the request need by OVH */ - private function getHeader($method,$query,$body = '') { + private function getHeader($method, $query, $body = '') { $timestamp = time() + $this->attrs['timedelta']; $prehash = $this->attrs['AS'].'+'.$this->attrs['CK'].'+'.$method.'+'.$query.'+'.$body.'+'.$timestamp; $header = [ diff --git a/lib/Service/Gateway/SMS/Provider/SipGate.php b/lib/Service/Gateway/SMS/Provider/SipGate.php index b1931ea..3d18ad5 100644 --- a/lib/Service/Gateway/SMS/Provider/SipGate.php +++ b/lib/Service/Gateway/SMS/Provider/SipGate.php @@ -63,10 +63,10 @@ class SipGate implements IProvider { 'Accept' => 'application/json', ], 'json' => [ - "smsId" => $webSmsExtension, - "message" => $message, - "recipient" => $identifier, - "sendAt" => null, + "smsId" => $webSmsExtension, + "message" => $message, + "recipient" => $identifier, + "sendAt" => null, ], ]); } catch (Exception $ex) { @@ -80,5 +80,4 @@ class SipGate implements IProvider { public function getConfig(): IProviderConfig { return $this->config; } - } diff --git a/lib/Service/Gateway/SMS/Provider/SipGateConfig.php b/lib/Service/Gateway/SMS/Provider/SipGateConfig.php index d61532c..274bd85 100644 --- a/lib/Service/Gateway/SMS/Provider/SipGateConfig.php +++ b/lib/Service/Gateway/SMS/Provider/SipGateConfig.php @@ -31,7 +31,7 @@ class SipGateConfig implements IProviderConfig { private const expected = [ 'sipgate_token_id', 'sipgate_access_token', - 'sipgate_web_sms_extension', + 'sipgate_web_sms_extension', ]; /** @var IConfig */ |