forked from LiveCarta/PayPal-PHP-Server-SDK
NetworkTransactionReference: id should not be required
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user