-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update SDK from api-definitions (#657)
Co-authored-by: rebilly-machine-user <[email protected]> Co-authored-by: Arif Kurkchi <[email protected]>
- Loading branch information
1 parent
4c63a66
commit bbe2bc6
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rebilly/client-php": patch | ||
--- | ||
|
||
Add amount limits to deposit request Rebilly/api-definitions#1666 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
/** | ||
* This source file is proprietary and part of Rebilly. | ||
* | ||
* (c) Rebilly SRL | ||
* Rebilly Ltd. | ||
* Rebilly Inc. | ||
* | ||
* @see https://www.rebilly.com | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rebilly\Sdk\Model; | ||
|
||
use JsonSerializable; | ||
|
||
class PostDepositRequestAmountLimits implements JsonSerializable | ||
{ | ||
private array $fields = []; | ||
|
||
public function __construct(array $data = []) | ||
{ | ||
if (array_key_exists('minimum', $data)) { | ||
$this->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; | ||
} | ||
} |