55class SmsIr extends AdapterAbstract implements AdapterInterface
66{
77
8- public $ gateway_url ;
8+ public $ gateway_url ;
99 private $ credential = [
10- 'user ' => '' ,
11- 'pass ' => '' ,
10+ 'user ' => '' ,
11+ 'pass ' => '' ,
1212 'lineNo ' => '' ,
1313 ];
1414
1515
1616 public function __construct ()
1717 {
18- $ this ->gateway_url = config ('iranian_sms.smsir.gateway ' );
19- $ this ->credential ['user ' ] = config ('iranian_sms.smsir.user ' );
20- $ this ->credential ['pass ' ] = config ('iranian_sms.smsir.pass ' );
21- $ this ->credential ['lineNo ' ] = config ('iranian_sms.smsir.lineNo ' );
18+ $ this ->gateway_url = config ('iranian_sms.smsir.gateway ' );
19+ $ this ->credential ['user ' ] = config ('iranian_sms.smsir.user ' );
20+ $ this ->credential ['pass ' ] = config ('iranian_sms.smsir.pass ' );
21+ $ this ->credential ['lineNo ' ] = config ('iranian_sms.smsir.line_no ' );
2222 }
2323
2424 public function send (String $ number , String $ message )
@@ -27,22 +27,19 @@ public function send(String $number, String $message)
2727 $ number = $ this ->filterNumber ($ number );
2828
2929 $ propertiesObject = [
30- 'user ' => $ this ->credential ['user ' ],
31- 'pass ' => $ this ->credential ['pass ' ],
30+ 'user ' => $ this ->credential ['user ' ],
31+ 'pass ' => $ this ->credential ['pass ' ],
3232 'lineNo ' => $ this ->credential ['lineNo ' ],
33- 'to ' => $ number ,
34- 'text ' => $ message
33+ 'to ' => $ number ,
34+ 'text ' => $ message,
3535 ];
3636
37- $ ch = curl_init ($ this ->gateway_url . '? ' . http_build_query ($ propertiesObject )); // such as http://example.com/example.xml
37+ $ ch = curl_init ($ this ->gateway_url . '? ' . http_build_query ($ propertiesObject )); // such as http://example.com/example.xml
3838 curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true );
3939 curl_setopt ($ ch , CURLOPT_HEADER , 0 );
4040 $ data = curl_exec ($ ch );
4141 curl_close ($ ch );
4242
4343 return $ data ;
44- // throw new \Exception("SMS cannot be send!");
4544 }
46-
47-
4845}
0 commit comments