Skip to content
Merged
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
16 changes: 16 additions & 0 deletions src/Octopush/Api/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ class Client
*/
private $requestMode = self::REQUEST_MODE_REAL;

/**
* Allows you to choose transactional mode.
*
* @var bool
*/
private $transactional = false;

/**
* Lists the key fields of the application you want to add in the sha1 hash.
*
Expand Down Expand Up @@ -123,6 +130,11 @@ public function setRequestKeys($requestKeys)
$this->requestKeys = $requestKeys;
}

public function setTransactional()
{
$this->transactional=true;
}

/**
* Sends a simple SMS.
*
Expand All @@ -144,6 +156,10 @@ public function send($smsText)
'request_mode' => $this->requestMode,
];

if ($this->transactional) {
$data['transactional'] = 1;
}

if ($this->withReplies) {
$data['with_replies'] = 1;
}
Expand Down