Skip to content

Commit 742b337

Browse files
update SDK from api-definitions
1 parent d619b4b commit 742b337

8 files changed

+157
-0
lines changed

.changeset/lucky-knives-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@rebilly/client-php": patch
3+
---
4+
5+
feat(be): Add PayCom integration Rebilly/rebilly#9093

src/Model/GatewayAccount.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ abstract class GatewayAccount implements JsonSerializable
287287

288288
public const GATEWAY_NAME_PAY_CLUB = 'PayClub';
289289

290+
public const GATEWAY_NAME_PAY_COM = 'PayCom';
291+
290292
public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';
291293

292294
public const GATEWAY_NAME_PAYEEZY = 'Payeezy';
@@ -1623,6 +1625,8 @@ public static function from(array $data = []): self
16231625
return PayCash::from($data);
16241626
case 'PayClub':
16251627
return PayClub::from($data);
1628+
case 'PayCom':
1629+
return PayCom::from($data);
16261630
case 'PayEcards':
16271631
return PayEcards::from($data);
16281632
case 'Payeezy':

src/Model/GetPayoutRequestPaymentInstrumentsResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable
286286

287287
public const GATEWAY_NAME_PAY_CLUB = 'PayClub';
288288

289+
public const GATEWAY_NAME_PAY_COM = 'PayCom';
290+
289291
public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';
290292

291293
public const GATEWAY_NAME_PAYEEZY = 'Payeezy';

src/Model/PayCom.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
3+
/**
4+
* This source file is proprietary and part of Rebilly.
5+
*
6+
* (c) Rebilly SRL
7+
* Rebilly Ltd.
8+
* Rebilly Inc.
9+
*
10+
* @see https://www.rebilly.com
11+
*/
12+
13+
declare(strict_types=1);
14+
15+
namespace Rebilly\Sdk\Model;
16+
17+
class PayCom extends GatewayAccount
18+
{
19+
private array $fields = [];
20+
21+
public function __construct(array $data = [])
22+
{
23+
parent::__construct([
24+
'gatewayName' => 'PayCom',
25+
] + $data);
26+
27+
if (array_key_exists('credentials', $data)) {
28+
$this->setCredentials($data['credentials']);
29+
}
30+
if (array_key_exists('threeDSecureServer', $data)) {
31+
$this->setThreeDSecureServer($data['threeDSecureServer']);
32+
}
33+
}
34+
35+
public static function from(array $data = []): self
36+
{
37+
return new self($data);
38+
}
39+
40+
public function getCredentials(): PayComCredentials
41+
{
42+
return $this->fields['credentials'];
43+
}
44+
45+
public function setCredentials(PayComCredentials|array $credentials): static
46+
{
47+
if (!($credentials instanceof PayComCredentials)) {
48+
$credentials = PayComCredentials::from($credentials);
49+
}
50+
51+
$this->fields['credentials'] = $credentials;
52+
53+
return $this;
54+
}
55+
56+
public function getThreeDSecureServer(): ?ThreeDSecureIO3dsServer
57+
{
58+
return $this->fields['threeDSecureServer'] ?? null;
59+
}
60+
61+
public function setThreeDSecureServer(null|ThreeDSecureIO3dsServer|array $threeDSecureServer): static
62+
{
63+
if ($threeDSecureServer !== null && !($threeDSecureServer instanceof ThreeDSecureIO3dsServer)) {
64+
$threeDSecureServer = ThreeDSecureIO3dsServer::from($threeDSecureServer);
65+
}
66+
67+
$this->fields['threeDSecureServer'] = $threeDSecureServer;
68+
69+
return $this;
70+
}
71+
72+
public function jsonSerialize(): array
73+
{
74+
$data = [];
75+
if (array_key_exists('credentials', $this->fields)) {
76+
$data['credentials'] = $this->fields['credentials']->jsonSerialize();
77+
}
78+
if (array_key_exists('threeDSecureServer', $this->fields)) {
79+
$data['threeDSecureServer'] = $this->fields['threeDSecureServer']?->jsonSerialize();
80+
}
81+
82+
return parent::jsonSerialize() + $data;
83+
}
84+
}

src/Model/PayComCredentials.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
/**
4+
* This source file is proprietary and part of Rebilly.
5+
*
6+
* (c) Rebilly SRL
7+
* Rebilly Ltd.
8+
* Rebilly Inc.
9+
*
10+
* @see https://www.rebilly.com
11+
*/
12+
13+
declare(strict_types=1);
14+
15+
namespace Rebilly\Sdk\Model;
16+
17+
use JsonSerializable;
18+
19+
class PayComCredentials implements JsonSerializable
20+
{
21+
private array $fields = [];
22+
23+
public function __construct(array $data = [])
24+
{
25+
if (array_key_exists('apiKey', $data)) {
26+
$this->setApiKey($data['apiKey']);
27+
}
28+
}
29+
30+
public static function from(array $data = []): self
31+
{
32+
return new self($data);
33+
}
34+
35+
public function getApiKey(): string
36+
{
37+
return $this->fields['apiKey'];
38+
}
39+
40+
public function setApiKey(string $apiKey): static
41+
{
42+
$this->fields['apiKey'] = $apiKey;
43+
44+
return $this;
45+
}
46+
47+
public function jsonSerialize(): array
48+
{
49+
$data = [];
50+
if (array_key_exists('apiKey', $this->fields)) {
51+
$data['apiKey'] = $this->fields['apiKey'];
52+
}
53+
54+
return $data;
55+
}
56+
}

src/Model/PayoutRequestAllocations.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,8 @@ class PayoutRequestAllocations implements JsonSerializable
666666

667667
public const GATEWAY_NAME_PAY_CLUB = 'PayClub';
668668

669+
public const GATEWAY_NAME_PAY_COM = 'PayCom';
670+
669671
public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';
670672

671673
public const GATEWAY_NAME_PAYEEZY = 'Payeezy';

src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa
284284

285285
public const GATEWAY_NAME_PAY_CLUB = 'PayClub';
286286

287+
public const GATEWAY_NAME_PAY_COM = 'PayCom';
288+
287289
public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';
288290

289291
public const GATEWAY_NAME_PAYEEZY = 'Payeezy';

src/Model/Transaction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ class Transaction implements JsonSerializable
342342

343343
public const GATEWAY_NAME_PAY_CLUB = 'PayClub';
344344

345+
public const GATEWAY_NAME_PAY_COM = 'PayCom';
346+
345347
public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards';
346348

347349
public const GATEWAY_NAME_PAYEEZY = 'Payeezy';

0 commit comments

Comments
 (0)