PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / vendor / square / square / src / Legacy / Models / UpdateOrderResponse.php

UpdateOrderResponse.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at vendor/square/square/src/Legacy/Models/UpdateOrderResponse.php

104 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Square\Legacy\Models;
6
7 use stdClass;
8
9 /**
10 * Defines the fields that are included in the response body of
11 * a request to the [UpdateOrder]($e/Orders/UpdateOrder) endpoint.
12 */
13 class UpdateOrderResponse implements \JsonSerializable
14 {
15 /**
16 * @var Order|null
17 */
18 private $order;
19
20 /**
21 * @var Error[]|null
22 */
23 private $errors;
24
25 /**
26 * Returns Order.
27 * Contains all information related to a single order to process with Square,
28 * including line items that specify the products to purchase. `Order` objects also
29 * include information about any associated tenders, refunds, and returns.
30 *
31 * All Connect V2 Transactions have all been converted to Orders including all associated
32 * itemization data.
33 */
34 public function getOrder(): ?Order
35 {
36 return $this->order;
37 }
38
39 /**
40 * Sets Order.
41 * Contains all information related to a single order to process with Square,
42 * including line items that specify the products to purchase. `Order` objects also
43 * include information about any associated tenders, refunds, and returns.
44 *
45 * All Connect V2 Transactions have all been converted to Orders including all associated
46 * itemization data.
47 *
48 * @maps order
49 */
50 public function setOrder(?Order $order): void
51 {
52 $this->order = $order;
53 }
54
55 /**
56 * Returns Errors.
57 * Any errors that occurred during the request.
58 *
59 * @return Error[]|null
60 */
61 public function getErrors(): ?array
62 {
63 return $this->errors;
64 }
65
66 /**
67 * Sets Errors.
68 * Any errors that occurred during the request.
69 *
70 * @maps errors
71 *
72 * @param Error[]|null $errors
73 */
74 public function setErrors(?array $errors): void
75 {
76 $this->errors = $errors;
77 }
78
79 /**
80 * Encode this object to JSON
81 *
82 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
83 * are set. (default: false)
84 *
85 * @return array|stdClass
86 */
87 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
88 public function jsonSerialize(bool $asArrayWhenEmpty = false)
89 {
90 $json = [];
91 if (isset($this->order)) {
92 $json['order'] = $this->order;
93 }
94 if (isset($this->errors)) {
95 $json['errors'] = $this->errors;
96 }
97 $json = array_filter($json, function ($val) {
98 return $val !== null;
99 });
100
101 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
102 }
103 }
104