1
0

NetworkTransactionReference: id should not be required

This commit is contained in:
2025-12-05 17:04:22 +01:00
parent 66fd3341bb
commit 3c7401787d

View File

@@ -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;
}