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 May 21, 2024
1 parent 35612de commit 9a8459a
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-glasses-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

SDK Generator updated
6 changes: 6 additions & 0 deletions src/Model/GatewayAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ abstract class GatewayAccount implements JsonSerializable

public const GATEWAY_NAME_PAY_TABS = 'PayTabs';

public const GATEWAY_NAME_PAY_U = 'PayU';

public const GATEWAY_NAME_PAY_U_LATAM = 'PayULatam';

public const GATEWAY_NAME_PAYVISION = 'Payvision';
Expand Down Expand Up @@ -706,6 +708,8 @@ abstract class GatewayAccount implements JsonSerializable

public const ACQUIRER_NAME_PAY_TABS = 'PayTabs';

public const ACQUIRER_NAME_PAY_U = 'PayU';

public const ACQUIRER_NAME_PAY_U_LATAM = 'PayULatam';

public const ACQUIRER_NAME_PAYVISION = 'Payvision';
Expand Down Expand Up @@ -1632,6 +1636,8 @@ public static function from(array $data = []): self
return Paysafecash::from($data);
case 'PayTabs':
return PayTabs::from($data);
case 'PayU':
return PayU::from($data);
case 'PayULatam':
return PayULatam::from($data);
case 'Payvision':
Expand Down
2 changes: 2 additions & 0 deletions src/Model/GetPayoutRequestPaymentInstrumentsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable

public const GATEWAY_NAME_PAY_TABS = 'PayTabs';

public const GATEWAY_NAME_PAY_U = 'PayU';

public const GATEWAY_NAME_PAY_U_LATAM = 'PayULatam';

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

public function __construct(array $data = [])
{
parent::__construct([
'gatewayName' => 'PayU',
] + $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(): PayUCredentials
{
return $this->fields['credentials'];
}

public function setCredentials(PayUCredentials|array $credentials): static
{
if (!($credentials instanceof PayUCredentials)) {
$credentials = PayUCredentials::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;
}
}
73 changes: 73 additions & 0 deletions src/Model/PayUCredentials.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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 PayUCredentials implements JsonSerializable
{
private array $fields = [];

public function __construct(array $data = [])
{
if (array_key_exists('merchantKey', $data)) {
$this->setMerchantKey($data['merchantKey']);
}
if (array_key_exists('merchantSalt', $data)) {
$this->setMerchantSalt($data['merchantSalt']);
}
}

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

public function getMerchantKey(): string
{
return $this->fields['merchantKey'];
}

public function setMerchantKey(string $merchantKey): static
{
$this->fields['merchantKey'] = $merchantKey;

return $this;
}

public function getMerchantSalt(): string
{
return $this->fields['merchantSalt'];
}

public function setMerchantSalt(string $merchantSalt): static
{
$this->fields['merchantSalt'] = $merchantSalt;

return $this;
}

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

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

public const GATEWAY_NAME_PAY_TABS = 'PayTabs';

public const GATEWAY_NAME_PAY_U = 'PayU';

public const GATEWAY_NAME_PAY_U_LATAM = 'PayULatam';

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

public const GATEWAY_NAME_PAY_TABS = 'PayTabs';

public const GATEWAY_NAME_PAY_U = 'PayU';

public const GATEWAY_NAME_PAY_U_LATAM = 'PayULatam';

public const GATEWAY_NAME_PAYVISION = 'Payvision';
Expand Down Expand Up @@ -703,6 +705,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa

public const ACQUIRER_NAME_PAY_TABS = 'PayTabs';

public const ACQUIRER_NAME_PAY_U = 'PayU';

public const ACQUIRER_NAME_PAY_U_LATAM = 'PayULatam';

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

public const GATEWAY_NAME_PAY_TABS = 'PayTabs';

public const GATEWAY_NAME_PAY_U = 'PayU';

public const GATEWAY_NAME_PAY_U_LATAM = 'PayULatam';

public const GATEWAY_NAME_PAYVISION = 'Payvision';
Expand Down Expand Up @@ -761,6 +763,8 @@ class Transaction implements JsonSerializable

public const ACQUIRER_NAME_PAY_TABS = 'PayTabs';

public const ACQUIRER_NAME_PAY_U = 'PayU';

public const ACQUIRER_NAME_PAY_U_LATAM = 'PayULatam';

public const ACQUIRER_NAME_PAYVISION = 'Payvision';
Expand Down

0 comments on commit 9a8459a

Please sign in to comment.