Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#727)
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 21, 2024
1 parent fbe7dbc commit fff8528
Show file tree
Hide file tree
Showing 14 changed files with 186 additions and 98 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-walls-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

feat(be): Add Omnimatrix integration Rebilly/rebilly#8616
5 changes: 5 additions & 0 deletions .changeset/small-planes-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

feat(api-definitions): Remove TestSandbox3dsServer from supported 3ds servers Rebilly/rebilly#8718
6 changes: 6 additions & 0 deletions src/Model/GatewayAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ abstract class GatewayAccount implements JsonSerializable

public const GATEWAY_NAME_OCHA_PAY = 'OchaPay';

public const GATEWAY_NAME_OMNI_MATRIX = 'OmniMatrix';

public const GATEWAY_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

public const GATEWAY_NAME_ON_RAMP = 'OnRamp';
Expand Down Expand Up @@ -666,6 +668,8 @@ abstract class GatewayAccount implements JsonSerializable

public const ACQUIRER_NAME_OCHA_PAY = 'OchaPay';

public const ACQUIRER_NAME_OMNI_MATRIX = 'OmniMatrix';

public const ACQUIRER_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

public const ACQUIRER_NAME_ON_RAMP = 'OnRamp';
Expand Down Expand Up @@ -1590,6 +1594,8 @@ public static function from(array $data = []): self
return NuaPay::from($data);
case 'OchaPay':
return OchaPay::from($data);
case 'OmniMatrix':
return OmniMatrix::from($data);
case 'Onlineueberweisen':
return Onlineueberweisen::from($data);
case 'OnRamp':
Expand Down
2 changes: 2 additions & 0 deletions src/Model/GetPayoutRequestPaymentInstrumentsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable

public const GATEWAY_NAME_OCHA_PAY = 'OchaPay';

public const GATEWAY_NAME_OMNI_MATRIX = 'OmniMatrix';

public const GATEWAY_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

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

public function __construct(array $data = [])
{
parent::__construct([
'gatewayName' => 'OmniMatrix',
] + $data);

if (array_key_exists('credentials', $data)) {
$this->setCredentials($data['credentials']);
}
}

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

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

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

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

return $this;
}

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

return parent::jsonSerialize() + $data;
}
}
73 changes: 73 additions & 0 deletions src/Model/OmniMatrixCredentials.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 OmniMatrixCredentials implements JsonSerializable
{
private array $fields = [];

public function __construct(array $data = [])
{
if (array_key_exists('merchantId', $data)) {
$this->setMerchantId($data['merchantId']);
}
if (array_key_exists('secret', $data)) {
$this->setSecret($data['secret']);
}
}

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

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

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

return $this;
}

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

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

return $this;
}

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

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

public const GATEWAY_NAME_OCHA_PAY = 'OchaPay';

public const GATEWAY_NAME_OMNI_MATRIX = 'OmniMatrix';

public const GATEWAY_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

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

public const GATEWAY_NAME_OCHA_PAY = 'OchaPay';

public const GATEWAY_NAME_OMNI_MATRIX = 'OmniMatrix';

public const GATEWAY_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

public const GATEWAY_NAME_ON_RAMP = 'OnRamp';
Expand Down Expand Up @@ -663,6 +665,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa

public const ACQUIRER_NAME_OCHA_PAY = 'OchaPay';

public const ACQUIRER_NAME_OMNI_MATRIX = 'OmniMatrix';

public const ACQUIRER_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

public const ACQUIRER_NAME_ON_RAMP = 'OnRamp';
Expand Down
8 changes: 4 additions & 4 deletions src/Model/TestProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public static function from(array $data = []): self
return new self($data);
}

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

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

$this->fields['threeDSecureServer'] = $threeDSecureServer;
Expand Down
40 changes: 0 additions & 40 deletions src/Model/TestProcessor3dsServer.php

This file was deleted.

21 changes: 0 additions & 21 deletions src/Model/TestProcessor3dsServers.php

This file was deleted.

28 changes: 0 additions & 28 deletions src/Model/TestProcessor3dsServersFactory.php

This file was deleted.

25 changes: 20 additions & 5 deletions src/Model/ThreeDSecureIO3dsServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@

namespace Rebilly\Sdk\Model;

class ThreeDSecureIO3dsServer implements TestProcessor3dsServers
use JsonSerializable;

class ThreeDSecureIO3dsServer implements JsonSerializable
{
public const NAME_THREE_D_SECURE_IO3DS_SERVER = 'ThreeDSecureIO3dsServer';

public const TRANSACTION_TYPE_01 = '01';

public const TRANSACTION_TYPE_03 = '03';
Expand Down Expand Up @@ -51,6 +55,9 @@ class ThreeDSecureIO3dsServer implements TestProcessor3dsServers

public function __construct(array $data = [])
{
if (array_key_exists('name', $data)) {
$this->setName($data['name']);
}
if (array_key_exists('acquirerMerchantIdVisa', $data)) {
$this->setAcquirerMerchantIdVisa($data['acquirerMerchantIdVisa']);
}
Expand Down Expand Up @@ -111,7 +118,14 @@ public static function from(array $data = []): self

public function getName(): string
{
return 'ThreeDSecureIO3dsServer';
return $this->fields['name'];
}

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

return $this;
}

public function getAcquirerMerchantIdVisa(): string
Expand Down Expand Up @@ -320,9 +334,10 @@ public function setThreeRIInd(null|string $threeRIInd): static

public function jsonSerialize(): array
{
$data = [
'name' => 'ThreeDSecureIO3dsServer',
];
$data = [];
if (array_key_exists('name', $this->fields)) {
$data['name'] = $this->fields['name'];
}
if (array_key_exists('acquirerMerchantIdVisa', $this->fields)) {
$data['acquirerMerchantIdVisa'] = $this->fields['acquirerMerchantIdVisa'];
}
Expand Down
4 changes: 4 additions & 0 deletions src/Model/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ class Transaction implements JsonSerializable

public const GATEWAY_NAME_OCHA_PAY = 'OchaPay';

public const GATEWAY_NAME_OMNI_MATRIX = 'OmniMatrix';

public const GATEWAY_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

public const GATEWAY_NAME_ON_RAMP = 'OnRamp';
Expand Down Expand Up @@ -721,6 +723,8 @@ class Transaction implements JsonSerializable

public const ACQUIRER_NAME_OCHA_PAY = 'OchaPay';

public const ACQUIRER_NAME_OMNI_MATRIX = 'OmniMatrix';

public const ACQUIRER_NAME_ONLINEUEBERWEISEN = 'Onlineueberweisen';

public const ACQUIRER_NAME_ON_RAMP = 'OnRamp';
Expand Down

0 comments on commit fff8528

Please sign in to comment.