1
0

1 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
3c7401787d NetworkTransactionReference: id should not be required 2025-12-05 17:28:28 +01:00

View File

@@ -19,7 +19,7 @@ use stdClass;
class NetworkTransactionReference implements \JsonSerializable class NetworkTransactionReference implements \JsonSerializable
{ {
/** /**
* @var string * @var ?string
*/ */
private $id; private $id;
@@ -39,9 +39,9 @@ class NetworkTransactionReference implements \JsonSerializable
private $acquirerReferenceNumber; private $acquirerReferenceNumber;
/** /**
* @param string $id * @param string|null $id
*/ */
public function __construct(string $id) public function __construct(?string $id = null)
{ {
$this->id = $id; $this->id = $id;
} }
@@ -53,7 +53,7 @@ class NetworkTransactionReference implements \JsonSerializable
* is the "NRID" field in response. The pattern we expect for this field from Visa/Amex/CB/Discover is * is the "NRID" field in response. The pattern we expect for this field from Visa/Amex/CB/Discover is
* numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -. * numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -.
*/ */
public function getId(): string public function getId(): ?string
{ {
return $this->id; return $this->id;
} }
@@ -68,7 +68,7 @@ class NetworkTransactionReference implements \JsonSerializable
* @required * @required
* @maps id * @maps id
*/ */
public function setId(string $id): void public function setId(?string $id): void
{ {
$this->id = $id; $this->id = $id;
} }
@@ -167,7 +167,9 @@ class NetworkTransactionReference implements \JsonSerializable
public function jsonSerialize(bool $asArrayWhenEmpty = false) public function jsonSerialize(bool $asArrayWhenEmpty = false)
{ {
$json = []; $json = [];
$json['id'] = $this->id; if (isset($this->id)) {
$json['id'] = $this->id;
}
if (isset($this->date)) { if (isset($this->date)) {
$json['date'] = $this->date; $json['date'] = $this->date;
} }