Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#724)
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 Nov 14, 2024
1 parent c7b5175 commit 467f14e
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-lobsters-move.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/fuzzy-bugs-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

fix(api-definitions): Fix lint errors Rebilly/rebilly#8540
5 changes: 5 additions & 0 deletions .changeset/thirty-cobras-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

build(deps): merge passing FE dependabot PRs Rebilly/rebilly#8272
5 changes: 5 additions & 0 deletions .changeset/warm-cheetahs-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

feat(be): Add 3DS support to Paysafe Rebilly/rebilly#8434
5 changes: 5 additions & 0 deletions .changeset/wicked-melons-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

feat(api-definitions, backend): Add JWT to DepositRequest response Rebilly/rebilly#8345
18 changes: 18 additions & 0 deletions src/Model/DepositRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public function __construct(array $data = [])
if (array_key_exists('notificationUrl', $data)) {
$this->setNotificationUrl($data['notificationUrl']);
}
if (array_key_exists('cashierToken', $data)) {
$this->setCashierToken($data['cashierToken']);
}
if (array_key_exists('customFields', $data)) {
$this->setCustomFields($data['customFields']);
}
Expand Down Expand Up @@ -260,6 +263,11 @@ public function setNotificationUrl(null|string $notificationUrl): static
return $this;
}

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

public function getCustomFields(): ?array
{
return $this->fields['customFields'] ?? null;
Expand Down Expand Up @@ -351,6 +359,9 @@ public function jsonSerialize(): array
if (array_key_exists('notificationUrl', $this->fields)) {
$data['notificationUrl'] = $this->fields['notificationUrl'];
}
if (array_key_exists('cashierToken', $this->fields)) {
$data['cashierToken'] = $this->fields['cashierToken'];
}
if (array_key_exists('customFields', $this->fields)) {
$data['customFields'] = $this->fields['customFields'];
}
Expand Down Expand Up @@ -413,6 +424,13 @@ private function setProperties(null|array $properties): static
return $this;
}

private function setCashierToken(null|string $cashierToken): static
{
$this->fields['cashierToken'] = $cashierToken;

return $this;
}

private function setCreatedTime(null|DateTimeImmutable|string $createdTime): static
{
if ($createdTime !== null && !($createdTime instanceof DateTimeImmutable)) {
Expand Down
22 changes: 22 additions & 0 deletions src/Model/Paysafe.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('threeDSecureServer', $data)) {
$this->setThreeDSecureServer($data['threeDSecureServer']);
}
}

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

public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer
{
return $this->fields['threeDSecureServer'] ?? null;
}

public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static
{
if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) {
$threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer);
}

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

return $this;
}

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

return parent::jsonSerialize() + $data;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Model/SchedulingMethodImmediately.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Rebilly\Sdk\Model;

class SchedulingMethodImmediately implements ServicePeriodAnchorInstruction, InvoiceRetryScheduleInstruction, SettlementPeriod, ScheduleInstruction
class SchedulingMethodImmediately implements InvoiceRetryScheduleInstruction, SettlementPeriod, ScheduleInstruction
{
public function __construct(array $data = [])
{
Expand Down
4 changes: 4 additions & 0 deletions src/Model/ServicePeriodAnchorInstruction.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
interface ServicePeriodAnchorInstruction extends JsonSerializable
{
public function getMethod(): string;

public function getTime(): ?string;

public function setTime(null|string $time): static;
}
1 change: 0 additions & 1 deletion src/Model/ServicePeriodAnchorInstructionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public static function from(array $data = []): ServicePeriodAnchorInstruction
return match ($data['method']) {
'day-of-month' => SchedulingMethodDayOfMonth::from($data),
'day-of-week' => SchedulingMethodDayOfWeek::from($data),
'immediately' => SchedulingMethodImmediately::from($data),
default => throw new UnknownDiscriminatorValueException(),
};
}
Expand Down

0 comments on commit 467f14e

Please sign in to comment.