@@ -27,7 +27,7 @@ class SmsClient extends InstasentClient
2727 */
2828 public function sendSms ($ from , $ to , $ text , $ clientId = null )
2929 {
30- $ url = ( $ this ->useSecureChannel ) ? $ this -> secureChannel . ' /sms/ ' : $ this -> rootEndpoint .'/sms/ ' ;
30+ $ url = $ this ->secureChannel .'/sms/ ' ;
3131 $ httpMethod = 'POST ' ;
3232 $ data = array ('from ' => $ from , 'to ' => $ to , 'text ' => $ text );
3333 if ($ clientId ) {
@@ -47,7 +47,7 @@ public function sendSms($from, $to, $text, $clientId = null)
4747 */
4848 public function sendUnicodeSms ($ from , $ to , $ text , $ clientId = null )
4949 {
50- $ url = ( $ this ->useSecureChannel ) ? $ this -> secureChannel . ' /sms/ ' : $ this -> rootEndpoint .'/sms/ ' ;
50+ $ url = $ this ->secureChannel .'/sms/ ' ;
5151 $ httpMethod = 'POST ' ;
5252 $ data = array ('allowUnicode ' => true , 'from ' => $ from , 'to ' => $ to , 'text ' => $ text );
5353 if ($ clientId ) {
@@ -67,7 +67,7 @@ public function sendUnicodeSms($from, $to, $text, $clientId = null)
6767 */
6868 public function sendBulkSms ($ messages , $ clientId = null )
6969 {
70- $ url = ( $ this ->useSecureChannel ) ? $ this -> secureChannel . ' /sms/bulk/ ' : $ this -> rootEndpoint .'/sms/bulk/ ' ;
70+ $ url = $ this ->secureChannel .'/sms/bulk/ ' ;
7171 $ httpMethod = 'POST ' ;
7272
7373 if ($ clientId ) {
@@ -84,7 +84,7 @@ public function sendBulkSms($messages, $clientId = null)
8484 */
8585 public function getSmsById ($ id )
8686 {
87- $ url = ( $ this ->useSecureChannel ) ? $ this -> secureChannel . ' /sms/ ' . $ id : $ this -> rootEndpoint .'/sms/ ' .$ id ;
87+ $ url = $ this ->secureChannel .'/sms/ ' .$ id ;
8888 $ httpMethod = 'GET ' ;
8989 return $ this ->execRequest ($ url , $ httpMethod , array ());
9090 }
@@ -99,7 +99,7 @@ public function getSmsById($id)
9999 public function getSms ($ page = 1 , $ perPage = 10 )
100100 {
101101 $ query = http_build_query (array ('page ' => $ page , 'per_page ' => $ perPage ));
102- $ url = ( $ this ->useSecureChannel ) ? $ this -> secureChannel . ' /sms/? ' . $ query : $ this -> rootEndpoint .'/sms/? ' .$ query ;
102+ $ url = $ this ->secureChannel .'/sms/? ' .$ query ;
103103 $ httpMethod = 'GET ' ;
104104 return $ this ->execRequest ($ url , $ httpMethod , array ());
105105 }
0 commit comments