PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13.1
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13.1
1.8.13.1 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 All 212 releases
charitable / vendor / square / square / src / Legacy / Models / VoidTransactionResponse.php

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

66 lines 1.5 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 [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint.
12 */
13 class VoidTransactionResponse implements \JsonSerializable
14 {
15 /**
16 * @var Error[]|null
17 */
18 private $errors;
19
20 /**
21 * Returns Errors.
22 * Any errors that occurred during the request.
23 *
24 * @return Error[]|null
25 */
26 public function getErrors(): ?array
27 {
28 return $this->errors;
29 }
30
31 /**
32 * Sets Errors.
33 * Any errors that occurred during the request.
34 *
35 * @maps errors
36 *
37 * @param Error[]|null $errors
38 */
39 public function setErrors(?array $errors): void
40 {
41 $this->errors = $errors;
42 }
43
44 /**
45 * Encode this object to JSON
46 *
47 * @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
48 * are set. (default: false)
49 *
50 * @return array|stdClass
51 */
52 #[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
53 public function jsonSerialize(bool $asArrayWhenEmpty = false)
54 {
55 $json = [];
56 if (isset($this->errors)) {
57 $json['errors'] = $this->errors;
58 }
59 $json = array_filter($json, function ($val) {
60 return $val !== null;
61 });
62
63 return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
64 }
65 }
66