From 83be3c7dd638841f88f64f76decd931915fe3728 Mon Sep 17 00:00:00 2001 From: rebilly-machine-user Date: Thu, 2 Nov 2023 19:46:03 +0000 Subject: [PATCH 1/3] update SDK from api-definitions --- .changeset/early-windows-speak.md | 5 ++ .changeset/gorgeous-bobcats-roll.md | 5 ++ .changeset/many-horses-juggle.md | 5 ++ src/Model/PostDepositRequest.php | 22 ++++++ src/Model/PostDepositRequestAmountLimits.php | 81 ++++++++++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 .changeset/early-windows-speak.md create mode 100644 .changeset/gorgeous-bobcats-roll.md create mode 100644 .changeset/many-horses-juggle.md create mode 100644 src/Model/PostDepositRequestAmountLimits.php diff --git a/.changeset/early-windows-speak.md b/.changeset/early-windows-speak.md new file mode 100644 index 000000000..8ed50a86f --- /dev/null +++ b/.changeset/early-windows-speak.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +Add security [] to billing portal and checkout form Rebilly/api-definitions#1671 diff --git a/.changeset/gorgeous-bobcats-roll.md b/.changeset/gorgeous-bobcats-roll.md new file mode 100644 index 000000000..6e1ae9e42 --- /dev/null +++ b/.changeset/gorgeous-bobcats-roll.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +Add amount limits to deposit request Rebilly/api-definitions#1666 diff --git a/.changeset/many-horses-juggle.md b/.changeset/many-horses-juggle.md new file mode 100644 index 000000000..4d0998a5a --- /dev/null +++ b/.changeset/many-horses-juggle.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +SDK Generator updated diff --git a/src/Model/PostDepositRequest.php b/src/Model/PostDepositRequest.php index 37dbc20e5..a903e3554 100644 --- a/src/Model/PostDepositRequest.php +++ b/src/Model/PostDepositRequest.php @@ -38,6 +38,9 @@ public function __construct(array $data = []) if (array_key_exists('amounts', $data)) { $this->setAmounts($data['amounts']); } + if (array_key_exists('amountLimits', $data)) { + $this->setAmountLimits($data['amountLimits']); + } if (array_key_exists('customAmount', $data)) { $this->setCustomAmount($data['customAmount']); } @@ -128,6 +131,22 @@ public function setAmounts(null|array $amounts): static return $this; } + public function getAmountLimits(): ?PostDepositRequestAmountLimits + { + return $this->fields['amountLimits'] ?? null; + } + + public function setAmountLimits(null|PostDepositRequestAmountLimits|array $amountLimits): static + { + if ($amountLimits !== null && !($amountLimits instanceof PostDepositRequestAmountLimits)) { + $amountLimits = PostDepositRequestAmountLimits::from($amountLimits); + } + + $this->fields['amountLimits'] = $amountLimits; + + return $this; + } + public function getCustomAmount(): ?DepositRequestCustomAmount { return $this->fields['customAmount'] ?? null; @@ -202,6 +221,9 @@ public function jsonSerialize(): array if (array_key_exists('amounts', $this->fields)) { $data['amounts'] = $this->fields['amounts']; } + if (array_key_exists('amountLimits', $this->fields)) { + $data['amountLimits'] = $this->fields['amountLimits']?->jsonSerialize(); + } if (array_key_exists('customAmount', $this->fields)) { $data['customAmount'] = $this->fields['customAmount']?->jsonSerialize(); } diff --git a/src/Model/PostDepositRequestAmountLimits.php b/src/Model/PostDepositRequestAmountLimits.php new file mode 100644 index 000000000..bf667771c --- /dev/null +++ b/src/Model/PostDepositRequestAmountLimits.php @@ -0,0 +1,81 @@ +setMinimum($data['minimum']); + } + if (array_key_exists('maximum', $data)) { + $this->setMaximum($data['maximum']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getMinimum(): ?float + { + return $this->fields['minimum'] ?? null; + } + + public function setMinimum(null|float|string $minimum): static + { + if (is_string($minimum)) { + $minimum = (float) $minimum; + } + + $this->fields['minimum'] = $minimum; + + return $this; + } + + public function getMaximum(): ?float + { + return $this->fields['maximum'] ?? null; + } + + public function setMaximum(null|float|string $maximum): static + { + if (is_string($maximum)) { + $maximum = (float) $maximum; + } + + $this->fields['maximum'] = $maximum; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('minimum', $this->fields)) { + $data['minimum'] = $this->fields['minimum']; + } + if (array_key_exists('maximum', $this->fields)) { + $data['maximum'] = $this->fields['maximum']; + } + + return $data; + } +} From a71548925540dcbfa17863e62a468f9661b049a9 Mon Sep 17 00:00:00 2001 From: Arif Kurkchi <11618962+justnero@users.noreply.github.com> Date: Fri, 3 Nov 2023 23:30:37 +0300 Subject: [PATCH 2/3] Delete .changeset/many-horses-juggle.md --- .changeset/many-horses-juggle.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/many-horses-juggle.md diff --git a/.changeset/many-horses-juggle.md b/.changeset/many-horses-juggle.md deleted file mode 100644 index 4d0998a5a..000000000 --- a/.changeset/many-horses-juggle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rebilly/client-php": patch ---- - -SDK Generator updated From 67695ba2a06d704627f529ed7785ec45794d5875 Mon Sep 17 00:00:00 2001 From: Arif Kurkchi <11618962+justnero@users.noreply.github.com> Date: Fri, 3 Nov 2023 23:32:18 +0300 Subject: [PATCH 3/3] Delete .changeset/early-windows-speak.md --- .changeset/early-windows-speak.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/early-windows-speak.md diff --git a/.changeset/early-windows-speak.md b/.changeset/early-windows-speak.md deleted file mode 100644 index 8ed50a86f..000000000 --- a/.changeset/early-windows-speak.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rebilly/client-php": patch ---- - -Add security [] to billing portal and checkout form Rebilly/api-definitions#1671