Skip to content

Commit

Permalink
update SDK from api-definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
rebilly-machine-user authored May 3, 2024
1 parent 7316cbd commit 58b1443
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-books-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add optional credentials to Buckaroo Rebilly/api-definitions#1884
36 changes: 36 additions & 0 deletions src/Model/BuckarooCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class BuckarooCredentials implements JsonSerializable

public function __construct(array $data = [])
{
if (array_key_exists('debtorCode', $data)) {
$this->setDebtorCode($data['debtorCode']);
}
if (array_key_exists('schemeKey', $data)) {
$this->setSchemeKey($data['schemeKey']);
}
if (array_key_exists('websiteKey', $data)) {
$this->setWebsiteKey($data['websiteKey']);
}
Expand All @@ -34,6 +40,30 @@ public static function from(array $data = []): self
return new self($data);
}

public function getDebtorCode(): ?string
{
return $this->fields['debtorCode'] ?? null;
}

public function setDebtorCode(null|string $debtorCode): static
{
$this->fields['debtorCode'] = $debtorCode;

return $this;
}

public function getSchemeKey(): ?string
{
return $this->fields['schemeKey'] ?? null;
}

public function setSchemeKey(null|string $schemeKey): static
{
$this->fields['schemeKey'] = $schemeKey;

return $this;
}

public function getWebsiteKey(): string
{
return $this->fields['websiteKey'];
Expand Down Expand Up @@ -61,6 +91,12 @@ public function setSecretKey(string $secretKey): static
public function jsonSerialize(): array
{
$data = [];
if (array_key_exists('debtorCode', $this->fields)) {
$data['debtorCode'] = $this->fields['debtorCode'];
}
if (array_key_exists('schemeKey', $this->fields)) {
$data['schemeKey'] = $this->fields['schemeKey'];
}
if (array_key_exists('websiteKey', $this->fields)) {
$data['websiteKey'] = $this->fields['websiteKey'];
}
Expand Down

0 comments on commit 58b1443

Please sign in to comment.