Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions classes/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public function send()
$arrParams['udh'] = $this->strUdh;
}

if ($this->intCategory) {
$arrParams['smscat'] = $this->intCategory;
}

$this->objLogger->addDebug('Sending the following to txtNation:', $arrParams);

$objClient = new Client([
Expand Down
16 changes: 16 additions & 0 deletions classes/SMSMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SMSMessage extends Request
protected $fltValue = null;
protected $strCurrency = null;
protected $intReply = null;
protected $intCategory = null;
protected $strEncoding = null;
protected $blBinary = null;
protected $strUdh = null;
Expand Down Expand Up @@ -200,6 +201,21 @@ public function binary($blBinary)
return $this;
}

public function category($intCategory)
{
if (!(Validator::numeric()->notEmpty()->length(3, 3)->validate($intCategory))) {
$this->objLogger->addError('Category must be a numeric string with a length of 3.');

throw new SMSMessageException('Category must be a numeric string with a length of 3.');
}

$this->intCategory = $intCategory;

$this->objLogger->addDebug('Category has been set to ' . $intCategory);

return $this;
}

protected function validate()
{
$this->objLogger->addDebug('Validating the request');
Expand Down