Skip to content

Commit ff14573

Browse files
authored
Merge pull request #6 from stof/required_gc_fields
Mark the gcId and gcClaimCode as required members in the result
2 parents 26b8cf4 + e89162b commit ff14573

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

manifest/api-2.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@
247247
"required": [
248248
"creationRequestId",
249249
"cardInfo",
250-
"status"
250+
"status",
251+
"gcClaimCode",
252+
"gcId"
251253
],
252254
"members": {
253255
"cardInfo": {

src/Result/CreateGiftCardResponse.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class CreateGiftCardResponse extends Result
2626
private $status;
2727

2828
/**
29-
* @var string|null
29+
* @var string
3030
*/
3131
private $gcClaimCode;
3232

3333
/**
34-
* @var string|null
34+
* @var string
3535
*/
3636
private $gcId;
3737

@@ -54,7 +54,7 @@ public function getCreationRequestId(): string
5454
return $this->creationRequestId;
5555
}
5656

57-
public function getGcClaimCode(): ?string
57+
public function getGcClaimCode(): string
5858
{
5959
$this->initialize();
6060

@@ -68,7 +68,7 @@ public function getGcExpirationDate(): ?\DateTimeImmutable
6868
return $this->gcExpirationDate;
6969
}
7070

71-
public function getGcId(): ?string
71+
public function getGcId(): string
7272
{
7373
$this->initialize();
7474

@@ -97,8 +97,8 @@ protected function populateResult(Response $response): void
9797
]);
9898
$this->creationRequestId = (string) $data->creationRequestId;
9999
$this->status = (string) $data->status;
100-
$this->gcClaimCode = ($v = $data->gcClaimCode) ? (string) $v : null;
101-
$this->gcId = ($v = $data->gcId) ? (string) $v : null;
100+
$this->gcClaimCode = (string) $data->gcClaimCode;
101+
$this->gcId = (string) $data->gcId;
102102
$this->gcExpirationDate = ($v = $data->gcExpirationDate) ? new \DateTimeImmutable((string) $v) : null;
103103
}
104104
}

0 commit comments

Comments
 (0)