Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#716)
Browse files Browse the repository at this point in the history
Co-authored-by: justnero <[email protected]>
Co-authored-by: Arif Kurkchi <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2024
1 parent 1bb927f commit fc1e6a2
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-wasps-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Update Conekta OXXO URL (Rebilly/rebilly#7396)
5 changes: 5 additions & 0 deletions .changeset/light-spiders-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add IPN signature support to Chillstock (Rebilly/rebilly#7615)
5 changes: 5 additions & 0 deletions .changeset/smooth-papayas-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add ignoreRecurring for change items (Rebilly/rebilly#7433)
5 changes: 5 additions & 0 deletions .changeset/wet-clouds-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add new website payment form setting hideZeroAmountSummaryItems (Rebilly/rebilly#7462)
18 changes: 18 additions & 0 deletions src/Model/ChillstockCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function __construct(array $data = [])
if (array_key_exists('privateKey', $data)) {
$this->setPrivateKey($data['privateKey']);
}
if (array_key_exists('publicKey', $data)) {
$this->setPublicKey($data['publicKey']);
}
}

public static function from(array $data = []): self
Expand Down Expand Up @@ -58,6 +61,18 @@ public function setPrivateKey(string $privateKey): static
return $this;
}

public function getPublicKey(): ?string
{
return $this->fields['publicKey'] ?? null;
}

public function setPublicKey(null|string $publicKey): static
{
$this->fields['publicKey'] = $publicKey;

return $this;
}

public function jsonSerialize(): array
{
$data = [];
Expand All @@ -67,6 +82,9 @@ public function jsonSerialize(): array
if (array_key_exists('privateKey', $this->fields)) {
$data['privateKey'] = $this->fields['privateKey'];
}
if (array_key_exists('publicKey', $this->fields)) {
$data['publicKey'] = $this->fields['publicKey'];
}

return $data;
}
Expand Down
22 changes: 22 additions & 0 deletions src/Model/Conekta.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']);
}
}

public static function from(array $data = []): self
Expand All @@ -49,12 +52,31 @@ public function setCredentials(ConektaCredentials|array $credentials): static
return $this;
}

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

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

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

return $this;
}

public function jsonSerialize(): array
{
$data = [];
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();
}

return parent::jsonSerialize() + $data;
}
Expand Down
55 changes: 55 additions & 0 deletions src/Model/ConektaSettings.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 ConektaSettings implements JsonSerializable
{
private array $fields = [];

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

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

public function getBaseUrl(): ?string
{
return $this->fields['baseUrl'] ?? null;
}

public function setBaseUrl(null|string $baseUrl): static
{
$this->fields['baseUrl'] = $baseUrl;

return $this;
}

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

return $data;
}
}
18 changes: 18 additions & 0 deletions src/Model/SubscriptionChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public function __construct(array $data = [])
if (array_key_exists('keepTrial', $data)) {
$this->setKeepTrial($data['keepTrial']);
}
if (array_key_exists('ignoreRecurring', $data)) {
$this->setIgnoreRecurring($data['ignoreRecurring']);
}
}

public static function from(array $data = []): self
Expand Down Expand Up @@ -139,6 +142,18 @@ public function setKeepTrial(null|bool $keepTrial): static
return $this;
}

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

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

return $this;
}

public function jsonSerialize(): array
{
$data = [];
Expand All @@ -163,6 +178,9 @@ public function jsonSerialize(): array
if (array_key_exists('keepTrial', $this->fields)) {
$data['keepTrial'] = $this->fields['keepTrial'];
}
if (array_key_exists('ignoreRecurring', $this->fields)) {
$data['ignoreRecurring'] = $this->fields['ignoreRecurring'];
}

return $data;
}
Expand Down
18 changes: 18 additions & 0 deletions src/Model/WebsiteSettingsPaymentFormFeatures.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public function __construct(array $data = [])
if (array_key_exists('skipRedirectOnPaymentComplete', $data)) {
$this->setSkipRedirectOnPaymentComplete($data['skipRedirectOnPaymentComplete']);
}
if (array_key_exists('hideZeroAmountSummaryItems', $data)) {
$this->setHideZeroAmountSummaryItems($data['hideZeroAmountSummaryItems']);
}
}

public static function from(array $data = []): self
Expand Down Expand Up @@ -79,6 +82,18 @@ public function setSkipRedirectOnPaymentComplete(null|bool $skipRedirectOnPaymen
return $this;
}

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

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

return $this;
}

public function jsonSerialize(): array
{
$data = [];
Expand All @@ -91,6 +106,9 @@ public function jsonSerialize(): array
if (array_key_exists('skipRedirectOnPaymentComplete', $this->fields)) {
$data['skipRedirectOnPaymentComplete'] = $this->fields['skipRedirectOnPaymentComplete'];
}
if (array_key_exists('hideZeroAmountSummaryItems', $this->fields)) {
$data['hideZeroAmountSummaryItems'] = $this->fields['hideZeroAmountSummaryItems'];
}

return $data;
}
Expand Down

0 comments on commit fc1e6a2

Please sign in to comment.