From 9ed4eb8f6437991dd70ef49c999386aa55fcc9c0 Mon Sep 17 00:00:00 2001 From: Rebilly Machine User Date: Thu, 26 Dec 2024 23:23:45 +0200 Subject: [PATCH] update SDK from api-definitions (#736) Co-authored-by: rebilly-machine-user --- .changeset/curvy-pets-cough.md | 5 + src/Model/GatewayAccount.php | 6 ++ ...ayoutRequestPaymentInstrumentsResponse.php | 2 + src/Model/Limepay.php | 62 +++++++++++++ src/Model/LimepayCredentials.php | 92 +++++++++++++++++++ src/Model/PayoutRequestAllocations.php | 2 + ...tionGatewayAcquirerWeightsWeightedList.php | 4 + src/Model/Transaction.php | 4 + 8 files changed, 177 insertions(+) create mode 100644 .changeset/curvy-pets-cough.md create mode 100644 src/Model/Limepay.php create mode 100644 src/Model/LimepayCredentials.php diff --git a/.changeset/curvy-pets-cough.md b/.changeset/curvy-pets-cough.md new file mode 100644 index 00000000..7465d6e8 --- /dev/null +++ b/.changeset/curvy-pets-cough.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(be): Add Limepay integration Rebilly/rebilly#9321 diff --git a/src/Model/GatewayAccount.php b/src/Model/GatewayAccount.php index 8bc84e97..35040d98 100644 --- a/src/Model/GatewayAccount.php +++ b/src/Model/GatewayAccount.php @@ -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'; @@ -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'; @@ -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': diff --git a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php index fb6455c6..265eeb5c 100644 --- a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php +++ b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php @@ -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'; diff --git a/src/Model/Limepay.php b/src/Model/Limepay.php new file mode 100644 index 00000000..b45376bc --- /dev/null +++ b/src/Model/Limepay.php @@ -0,0 +1,62 @@ + '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; + } +} diff --git a/src/Model/LimepayCredentials.php b/src/Model/LimepayCredentials.php new file mode 100644 index 00000000..c071467e --- /dev/null +++ b/src/Model/LimepayCredentials.php @@ -0,0 +1,92 @@ +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; + } +} diff --git a/src/Model/PayoutRequestAllocations.php b/src/Model/PayoutRequestAllocations.php index b20a2111..87f02cbf 100644 --- a/src/Model/PayoutRequestAllocations.php +++ b/src/Model/PayoutRequestAllocations.php @@ -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'; diff --git a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php index 0c12defd..f47fe650 100644 --- a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php +++ b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php @@ -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'; @@ -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'; diff --git a/src/Model/Transaction.php b/src/Model/Transaction.php index 16e4fcad..53802f3d 100644 --- a/src/Model/Transaction.php +++ b/src/Model/Transaction.php @@ -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'; @@ -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';