Skip to content

Commit

Permalink
update SDK from api-definitions (#736)
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 Dec 26, 2024
1 parent 1ddc7a6 commit 9ed4eb8
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/curvy-pets-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

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

public const GATEWAY_NAME_LA_CORE = 'LaCore';

public const GATEWAY_NAME_LIMEPAY = 'Limepay';

public const GATEWAY_NAME_LOONIE = 'loonie';

public const GATEWAY_NAME_LPG = 'LPG';
Expand Down Expand Up @@ -621,6 +623,8 @@ abstract class GatewayAccount implements JsonSerializable

public const ACQUIRER_NAME_KONNEKTIVE = 'Konnektive';

public const ACQUIRER_NAME_LIMEPAY = 'Limepay';

public const ACQUIRER_NAME_LOONIE = 'loonie';

public const ACQUIRER_NAME_LPG = 'LPG';
Expand Down Expand Up @@ -1553,6 +1557,8 @@ public static function from(array $data = []): self
return Konnektive::from($data);
case 'LaCore':
return LaCore::from($data);
case 'Limepay':
return Limepay::from($data);
case 'loonie':
return Loonie::from($data);
case 'LPG':
Expand Down
2 changes: 2 additions & 0 deletions src/Model/GetPayoutRequestPaymentInstrumentsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable

public const GATEWAY_NAME_LA_CORE = 'LaCore';

public const GATEWAY_NAME_LIMEPAY = 'Limepay';

public const GATEWAY_NAME_LOONIE = 'loonie';

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

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

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

public function __construct(array $data = [])
{
if (array_key_exists('xLogin', $data)) {
$this->setXLogin($data['xLogin']);
}
if (array_key_exists('xTransKey', $data)) {
$this->setXTransKey($data['xTransKey']);
}
if (array_key_exists('secretKey', $data)) {
$this->setSecretKey($data['secretKey']);
}
}

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

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

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

return $this;
}

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

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

return $this;
}

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

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

return $this;
}

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

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

public const GATEWAY_NAME_LA_CORE = 'LaCore';

public const GATEWAY_NAME_LIMEPAY = 'Limepay';

public const GATEWAY_NAME_LOONIE = 'loonie';

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

public const GATEWAY_NAME_LA_CORE = 'LaCore';

public const GATEWAY_NAME_LIMEPAY = 'Limepay';

public const GATEWAY_NAME_LOONIE = 'loonie';

public const GATEWAY_NAME_LPG = 'LPG';
Expand Down Expand Up @@ -618,6 +620,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa

public const ACQUIRER_NAME_KONNEKTIVE = 'Konnektive';

public const ACQUIRER_NAME_LIMEPAY = 'Limepay';

public const ACQUIRER_NAME_LOONIE = 'loonie';

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

public const GATEWAY_NAME_LA_CORE = 'LaCore';

public const GATEWAY_NAME_LIMEPAY = 'Limepay';

public const GATEWAY_NAME_LOONIE = 'loonie';

public const GATEWAY_NAME_LPG = 'LPG';
Expand Down Expand Up @@ -676,6 +678,8 @@ class Transaction implements JsonSerializable

public const ACQUIRER_NAME_KONNEKTIVE = 'Konnektive';

public const ACQUIRER_NAME_LIMEPAY = 'Limepay';

public const ACQUIRER_NAME_LOONIE = 'loonie';

public const ACQUIRER_NAME_LPG = 'LPG';
Expand Down

0 comments on commit 9ed4eb8

Please sign in to comment.