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 Oct 14, 2024
1 parent 63f248c commit 37d6504
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-timers-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

SDK Generator updated
5 changes: 5 additions & 0 deletions .changeset/good-news-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

feat(be): Tampered KYC document detection Rebilly/rebilly#7876
5 changes: 5 additions & 0 deletions .changeset/modern-geckos-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

revert(be): Tampered KYC document detection Rebilly/rebilly#8078
5 changes: 5 additions & 0 deletions .changeset/slow-owls-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

fix(api): Fix missing gate2way mapping Rebilly/rebilly#8029
61 changes: 61 additions & 0 deletions src/Model/Gate2way.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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;

class Gate2way extends GatewayAccount
{
private array $fields = [];

public function __construct(array $data = [])
{
parent::__construct([
'gatewayName' => 'gate2way',
] + $data);

if (array_key_exists('credentials', $data)) {
$this->setCredentials($data['credentials']);
}
}

public static function from(array $data = []): self
{
return new self($data);
}

public function getCredentials(): Gate2wayCredentials
{
return $this->fields['credentials'];
}

public function setCredentials(Gate2wayCredentials|array $credentials): static
{
if (!($credentials instanceof Gate2wayCredentials)) {
$credentials = Gate2wayCredentials::from($credentials);
}

$this->fields['credentials'] = $credentials;

return $this;
}

public function jsonSerialize(): array
{
$data = [];
if (array_key_exists('credentials', $this->fields)) {
$data['credentials'] = $this->fields['credentials']->jsonSerialize();
}

return parent::jsonSerialize() + $data;
}
}
73 changes: 73 additions & 0 deletions src/Model/Gate2wayCredentials.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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 Gate2wayCredentials implements JsonSerializable
{
private array $fields = [];

public function __construct(array $data = [])
{
if (array_key_exists('apiKey', $data)) {
$this->setApiKey($data['apiKey']);
}
if (array_key_exists('apiSecret', $data)) {
$this->setApiSecret($data['apiSecret']);
}
}

public static function from(array $data = []): self
{
return new self($data);
}

public function getApiKey(): string
{
return $this->fields['apiKey'];
}

public function setApiKey(string $apiKey): static
{
$this->fields['apiKey'] = $apiKey;

return $this;
}

public function getApiSecret(): string
{
return $this->fields['apiSecret'];
}

public function setApiSecret(string $apiSecret): static
{
$this->fields['apiSecret'] = $apiSecret;

return $this;
}

public function jsonSerialize(): array
{
$data = [];
if (array_key_exists('apiKey', $this->fields)) {
$data['apiKey'] = $this->fields['apiKey'];
}
if (array_key_exists('apiSecret', $this->fields)) {
$data['apiSecret'] = $this->fields['apiSecret'];
}

return $data;
}
}
2 changes: 2 additions & 0 deletions src/Model/GatewayAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,8 @@ public static function from(array $data = []): self
return Forte::from($data);
case 'FundSend':
return FundSend::from($data);
case 'gate2way':
return Gate2way::from($data);
case 'GET':
return GET::from($data);
case 'Gigadat':
Expand Down

0 comments on commit 37d6504

Please sign in to comment.