From 3c7401787d4409e9d444928ef7585c5314bb17a5 Mon Sep 17 00:00:00 2001 From: atsaruk Date: Fri, 5 Dec 2025 17:04:22 +0100 Subject: [PATCH] NetworkTransactionReference: id should not be required --- src/Models/NetworkTransactionReference.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Models/NetworkTransactionReference.php b/src/Models/NetworkTransactionReference.php index 9957b89..13262db 100644 --- a/src/Models/NetworkTransactionReference.php +++ b/src/Models/NetworkTransactionReference.php @@ -19,7 +19,7 @@ use stdClass; class NetworkTransactionReference implements \JsonSerializable { /** - * @var string + * @var ?string */ private $id; @@ -39,9 +39,9 @@ class NetworkTransactionReference implements \JsonSerializable private $acquirerReferenceNumber; /** - * @param string $id + * @param string|null $id */ - public function __construct(string $id) + public function __construct(?string $id = null) { $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 * numeric, Mastercard/BNPP is alphanumeric and Paysecure is alphanumeric with special character -. */ - public function getId(): string + public function getId(): ?string { return $this->id; } @@ -68,7 +68,7 @@ class NetworkTransactionReference implements \JsonSerializable * @required * @maps id */ - public function setId(string $id): void + public function setId(?string $id): void { $this->id = $id; } @@ -167,7 +167,9 @@ class NetworkTransactionReference implements \JsonSerializable public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; - $json['id'] = $this->id; + if (isset($this->id)) { + $json['id'] = $this->id; + } if (isset($this->date)) { $json['date'] = $this->date; }