Skip to content

Commit

Permalink
chore: update SDK from api-definitions (#689)
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 Apr 16, 2024
1 parent 8afcb51 commit 66edff0
Show file tree
Hide file tree
Showing 14 changed files with 185 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-eyes-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rebilly/client-php": patch
---

Add Unlimit gateway adapter Rebilly/api-definitions#1873
2 changes: 2 additions & 0 deletions src/Model/AlternativePaymentInstrument.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ class AlternativePaymentInstrument implements CustomerDefaultPaymentInstrument,

public const METHOD_SPARK_PAY = 'SparkPay';

public const METHOD_SPEI = 'SPEI';

public const METHOD_SWIFT_DBT = 'swift-dbt';

public const METHOD_TELE2 = 'Tele2';
Expand Down
2 changes: 2 additions & 0 deletions src/Model/CheckoutForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ class CheckoutForm implements JsonSerializable

public const PAYMENT_METHODS_SPARK_PAY = 'SparkPay';

public const PAYMENT_METHODS_SPEI = 'SPEI';

public const PAYMENT_METHODS_SWIFT_DBT = 'swift-dbt';

public const PAYMENT_METHODS_TELE2 = 'Tele2';
Expand Down
1 change: 1 addition & 0 deletions src/Model/CustomerDefaultPaymentInstrumentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public static function from(array $data = []): CustomerDefaultPaymentInstrument
'Resurs' => AlternativePaymentInstrument::from($data),
'SEPA' => AlternativePaymentInstrument::from($data),
'SMSVoucher' => AlternativePaymentInstrument::from($data),
'SPEI' => AlternativePaymentInstrument::from($data),
'SafetyPay' => AlternativePaymentInstrument::from($data),
'Samsung Pay' => AlternativePaymentInstrument::from($data),
'Siirto' => AlternativePaymentInstrument::from($data),
Expand Down
6 changes: 6 additions & 0 deletions src/Model/GatewayAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ abstract class GatewayAccount implements JsonSerializable

public const GATEWAY_NAME_TWINT = 'TWINT';

public const GATEWAY_NAME_UNLIMIT = 'Unlimit';

public const GATEWAY_NAME_U_PAY_CARD = 'UPayCard';

public const GATEWAY_NAME_US_AE_PAY = 'USAePay';
Expand Down Expand Up @@ -1114,6 +1116,8 @@ abstract class GatewayAccount implements JsonSerializable

public const METHOD_SPARK_PAY = 'SparkPay';

public const METHOD_SPEI = 'SPEI';

public const METHOD_SWIFT_DBT = 'swift-dbt';

public const METHOD_TELE2 = 'Tele2';
Expand Down Expand Up @@ -1702,6 +1706,8 @@ public static function from(array $data = []): self
return TrustsPay::from($data);
case 'TWINT':
return TWINT::from($data);
case 'Unlimit':
return Unlimit::from($data);
case 'UPayCard':
return UPayCard::from($data);
case 'USAePay':
Expand Down
2 changes: 2 additions & 0 deletions src/Model/GetPayoutRequestPaymentInstrumentsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable

public const GATEWAY_NAME_TWINT = 'TWINT';

public const GATEWAY_NAME_UNLIMIT = 'Unlimit';

public const GATEWAY_NAME_U_PAY_CARD = 'UPayCard';

public const GATEWAY_NAME_US_AE_PAY = 'USAePay';
Expand Down
2 changes: 2 additions & 0 deletions src/Model/PaymentInstructionMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ class PaymentInstructionMethods implements PaymentInstruction

public const METHODS_SPARK_PAY = 'SparkPay';

public const METHODS_SPEI = 'SPEI';

public const METHODS_SWIFT_DBT = 'swift-dbt';

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

public const METHOD_SPARK_PAY = 'SparkPay';

public const METHOD_SPEI = 'SPEI';

public const METHOD_SWIFT_DBT = 'swift-dbt';

public const METHOD_TELE2 = 'Tele2';
Expand Down Expand Up @@ -763,6 +765,8 @@ class PayoutRequestAllocations implements JsonSerializable

public const GATEWAY_NAME_TWINT = 'TWINT';

public const GATEWAY_NAME_UNLIMIT = 'Unlimit';

public const GATEWAY_NAME_U_PAY_CARD = 'UPayCard';

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

public const GATEWAY_NAME_TWINT = 'TWINT';

public const GATEWAY_NAME_UNLIMIT = 'Unlimit';

public const GATEWAY_NAME_U_PAY_CARD = 'UPayCard';

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

public const GATEWAY_NAME_TWINT = 'TWINT';

public const GATEWAY_NAME_UNLIMIT = 'Unlimit';

public const GATEWAY_NAME_U_PAY_CARD = 'UPayCard';

public const GATEWAY_NAME_US_AE_PAY = 'USAePay';
Expand Down Expand Up @@ -1169,6 +1171,8 @@ class Transaction implements JsonSerializable

public const METHOD_SPARK_PAY = 'SparkPay';

public const METHOD_SPEI = 'SPEI';

public const METHOD_SWIFT_DBT = 'swift-dbt';

public const METHOD_TELE2 = 'Tele2';
Expand Down
1 change: 1 addition & 0 deletions src/Model/TransactionPaymentInstrumentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public static function from(array $data = []): TransactionPaymentInstrument
'Resurs' => AlternativePaymentInstrument::from($data),
'SEPA' => AlternativePaymentInstrument::from($data),
'SMSVoucher' => AlternativePaymentInstrument::from($data),
'SPEI' => AlternativePaymentInstrument::from($data),
'SafetyPay' => AlternativePaymentInstrument::from($data),
'Samsung Pay' => AlternativePaymentInstrument::from($data),
'Siirto' => AlternativePaymentInstrument::from($data),
Expand Down
61 changes: 61 additions & 0 deletions src/Model/Unlimit.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 Unlimit extends GatewayAccount
{
private array $fields = [];

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

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

public function __construct(array $data = [])
{
if (array_key_exists('terminalId', $data)) {
$this->setTerminalId($data['terminalId']);
}
if (array_key_exists('password', $data)) {
$this->setPassword($data['password']);
}
if (array_key_exists('ipnSecret', $data)) {
$this->setIpnSecret($data['ipnSecret']);
}
}

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

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

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

return $this;
}

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

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

return $this;
}

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

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

return $this;
}

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

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

public const METHOD_SPARK_PAY = 'SparkPay';

public const METHOD_SPEI = 'SPEI';

public const METHOD_SWIFT_DBT = 'swift-dbt';

public const METHOD_TELE2 = 'Tele2';
Expand Down

0 comments on commit 66edff0

Please sign in to comment.