File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ public function send()
5656 $ arrParams ['udh ' ] = $ this ->strUdh ;
5757 }
5858
59+ if ($ this ->intCategory ) {
60+ $ arrParams ['smscat ' ] = $ this ->intCategory ;
61+ }
62+
5963 $ this ->objLogger ->addDebug ('Sending the following to txtNation: ' , $ arrParams );
6064
6165 $ objClient = new Client ([
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class SMSMessage extends Request
2525 protected $ fltValue = null ;
2626 protected $ strCurrency = null ;
2727 protected $ intReply = null ;
28+ protected $ intCategory = null ;
2829 protected $ strEncoding = null ;
2930 protected $ blBinary = null ;
3031 protected $ strUdh = null ;
@@ -200,6 +201,21 @@ public function binary($blBinary)
200201 return $ this ;
201202 }
202203
204+ public function category ($ intCategory )
205+ {
206+ if (!(Validator::numeric ()->notEmpty ()->length (3 , 3 )->validate ($ intCategory ))) {
207+ $ this ->objLogger ->addError ('Category must be a numeric string with a length of 3. ' );
208+
209+ throw new SMSMessageException ('Category must be a numeric string with a length of 3. ' );
210+ }
211+
212+ $ this ->intCategory = $ intCategory ;
213+
214+ $ this ->objLogger ->addDebug ('Category has been set to ' . $ intCategory );
215+
216+ return $ this ;
217+ }
218+
203219 protected function validate ()
204220 {
205221 $ this ->objLogger ->addDebug ('Validating the request ' );
You can’t perform that action at this time.
0 commit comments