From 58b1443246e028bab688b790b62c680f26245449 Mon Sep 17 00:00:00 2001 From: rebilly-machine-user Date: Fri, 3 May 2024 13:41:42 +0000 Subject: [PATCH] update SDK from api-definitions --- .changeset/four-books-rhyme.md | 5 +++++ src/Model/BuckarooCredentials.php | 36 +++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .changeset/four-books-rhyme.md diff --git a/.changeset/four-books-rhyme.md b/.changeset/four-books-rhyme.md new file mode 100644 index 000000000..91923c5b7 --- /dev/null +++ b/.changeset/four-books-rhyme.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +Add optional credentials to Buckaroo Rebilly/api-definitions#1884 diff --git a/src/Model/BuckarooCredentials.php b/src/Model/BuckarooCredentials.php index e4e608c04..6ed006e01 100644 --- a/src/Model/BuckarooCredentials.php +++ b/src/Model/BuckarooCredentials.php @@ -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']); } @@ -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']; @@ -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']; }