Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update SDK from api-definitions #730

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading