Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#694)
Browse files Browse the repository at this point in the history
Co-authored-by: rebilly-machine-user <[email protected]>
  • Loading branch information
rebilly-machine-user and rebilly-machine-user authored May 13, 2024
1 parent 0964f18 commit 35612de
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-guests-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add SecureTrading recurring settings Rebilly/api-definitions#1889
22 changes: 22 additions & 0 deletions src/Model/SecureTrading.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public function __construct(array $data = [])
if (array_key_exists('credentials', $data)) {
$this->setCredentials($data['credentials']);
}
if (array_key_exists('settings', $data)) {
$this->setSettings($data['settings']);
}
if (array_key_exists('threeDSecureServer', $data)) {
$this->setThreeDSecureServer($data['threeDSecureServer']);
}
Expand All @@ -52,6 +55,22 @@ public function setCredentials(SecureTradingCredentials|array $credentials): sta
return $this;
}

public function getSettings(): ?SecureTradingSettings
{
return $this->fields['settings'] ?? null;
}

public function setSettings(null|SecureTradingSettings|array $settings): static
{
if ($settings !== null && !($settings instanceof SecureTradingSettings)) {
$settings = SecureTradingSettings::from($settings);
}

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

return $this;
}

public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer
{
return $this->fields['threeDSecureServer'] ?? null;
Expand All @@ -74,6 +93,9 @@ public function jsonSerialize(): array
if (array_key_exists('credentials', $this->fields)) {
$data['credentials'] = $this->fields['credentials']->jsonSerialize();
}
if (array_key_exists('settings', $this->fields)) {
$data['settings'] = $this->fields['settings']?->jsonSerialize();
}
if (array_key_exists('threeDSecureServer', $this->fields)) {
$data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->jsonSerialize();
}
Expand Down
55 changes: 55 additions & 0 deletions src/Model/SecureTradingSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?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 SecureTradingSettings implements JsonSerializable
{
private array $fields = [];

public function __construct(array $data = [])
{
if (array_key_exists('enableRecurring', $data)) {
$this->setEnableRecurring($data['enableRecurring']);
}
}

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

public function getEnableRecurring(): ?bool
{
return $this->fields['enableRecurring'] ?? null;
}

public function setEnableRecurring(null|bool $enableRecurring): static
{
$this->fields['enableRecurring'] = $enableRecurring;

return $this;
}

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

return $data;
}
}

0 comments on commit 35612de

Please sign in to comment.