Skip to content

Commit

Permalink
Add update parameter to AddVoucherCodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ticketmatic authored and Ticketmatic Build committed May 20, 2019
1 parent 3f01238 commit 111ee53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Client {
*
* @var string
*/
const BUILD = "1.0.114";
const BUILD = "1.0.115";

/**
* Account code
Expand Down
4 changes: 3 additions & 1 deletion lib/Endpoints/Settings/Communicationanddesign/Ordermails.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*
* ## Types
*
* There are 5 types of order mail templates:
* There are 6 types of order mail templates:
*
* * **Confirmation (`3101`)**
*
Expand All @@ -54,6 +54,8 @@
*
* * **Expiration notices (`3105`)**
*
* * **Waitinglist group confirmation (`3106`)**
*
* ## Subject & Body
*
* Both the subject and body fields allow using Twig variables. These are described
Expand Down
12 changes: 12 additions & 0 deletions lib/Model/AddVoucherCodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public function __construct(array $data = array()) {
*/
public $count;

/**
* Whether or not to reactivate and update the expiry of already existing
* vouchercodes.
*
* @var bool
*/
public $update;

/**
* Unpack AddVoucherCodes from JSON.
*
Expand All @@ -88,6 +96,7 @@ public static function fromJson($obj) {
"amount" => isset($obj->amount) ? $obj->amount : null,
"codes" => isset($obj->codes) ? Json::unpackArray("VoucherCode", $obj->codes) : null,
"count" => isset($obj->count) ? $obj->count : null,
"update" => isset($obj->update) ? $obj->update : null,
));
}

Expand All @@ -107,6 +116,9 @@ public function jsonSerialize() {
if (!is_null($this->count)) {
$result["count"] = intval($this->count);
}
if (!is_null($this->update)) {
$result["update"] = (bool)$this->update;
}

return $result;
}
Expand Down

0 comments on commit 111ee53

Please sign in to comment.