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 Dec 10, 2024
1 parent d619b4b commit 742b337
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-knives-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

feat(be): Add PayCom integration Rebilly/rebilly#9093
4 changes: 4 additions & 0 deletions src/Model/GatewayAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ abstract class GatewayAccount implements JsonSerializable

public const GATEWAY_NAME_PAY_CLUB = 'PayClub';

public const GATEWAY_NAME_PAY_COM = 'PayCom';

public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';

public const GATEWAY_NAME_PAYEEZY = 'Payeezy';
Expand Down Expand Up @@ -1623,6 +1625,8 @@ public static function from(array $data = []): self
return PayCash::from($data);
case 'PayClub':
return PayClub::from($data);
case 'PayCom':
return PayCom::from($data);
case 'PayEcards':
return PayEcards::from($data);
case 'Payeezy':
Expand Down
2 changes: 2 additions & 0 deletions src/Model/GetPayoutRequestPaymentInstrumentsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable

public const GATEWAY_NAME_PAY_CLUB = 'PayClub';

public const GATEWAY_NAME_PAY_COM = 'PayCom';

public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';

public const GATEWAY_NAME_PAYEEZY = 'Payeezy';
Expand Down
84 changes: 84 additions & 0 deletions src/Model/PayCom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?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 PayCom extends GatewayAccount
{
private array $fields = [];

public function __construct(array $data = [])
{
parent::__construct([
'gatewayName' => 'PayCom',
] + $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
{
return new self($data);
}

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

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

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

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

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

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 jsonSerialize(): array
{
$data = [];
if (array_key_exists('apiKey', $this->fields)) {
$data['apiKey'] = $this->fields['apiKey'];
}

return $data;
}
}
2 changes: 2 additions & 0 deletions src/Model/PayoutRequestAllocations.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ class PayoutRequestAllocations implements JsonSerializable

public const GATEWAY_NAME_PAY_CLUB = 'PayClub';

public const GATEWAY_NAME_PAY_COM = 'PayCom';

public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';

public const GATEWAY_NAME_PAYEEZY = 'Payeezy';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa

public const GATEWAY_NAME_PAY_CLUB = 'PayClub';

public const GATEWAY_NAME_PAY_COM = 'PayCom';

public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';

public const GATEWAY_NAME_PAYEEZY = 'Payeezy';
Expand Down
2 changes: 2 additions & 0 deletions src/Model/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ class Transaction implements JsonSerializable

public const GATEWAY_NAME_PAY_CLUB = 'PayClub';

public const GATEWAY_NAME_PAY_COM = 'PayCom';

public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';

public const GATEWAY_NAME_PAYEEZY = 'Payeezy';
Expand Down

0 comments on commit 742b337

Please sign in to comment.