From 742b3370738aa7a771d41732cae70f2aae0772a4 Mon Sep 17 00:00:00 2001 From: rebilly-machine-user Date: Tue, 10 Dec 2024 14:47:20 +0000 Subject: [PATCH] update SDK from api-definitions --- .changeset/lucky-knives-explain.md | 5 ++ src/Model/GatewayAccount.php | 4 + ...ayoutRequestPaymentInstrumentsResponse.php | 2 + src/Model/PayCom.php | 84 +++++++++++++++++++ src/Model/PayComCredentials.php | 56 +++++++++++++ src/Model/PayoutRequestAllocations.php | 2 + ...tionGatewayAcquirerWeightsWeightedList.php | 2 + src/Model/Transaction.php | 2 + 8 files changed, 157 insertions(+) create mode 100644 .changeset/lucky-knives-explain.md create mode 100644 src/Model/PayCom.php create mode 100644 src/Model/PayComCredentials.php diff --git a/.changeset/lucky-knives-explain.md b/.changeset/lucky-knives-explain.md new file mode 100644 index 00000000..a1f2cb74 --- /dev/null +++ b/.changeset/lucky-knives-explain.md @@ -0,0 +1,5 @@ +--- +"@rebilly/client-php": patch +--- + +feat(be): Add PayCom integration Rebilly/rebilly#9093 diff --git a/src/Model/GatewayAccount.php b/src/Model/GatewayAccount.php index 1452947e..8bc84e97 100644 --- a/src/Model/GatewayAccount.php +++ b/src/Model/GatewayAccount.php @@ -287,6 +287,8 @@ abstract class GatewayAccount implements JsonSerializable public const GATEWAY_NAME_PAY_CLUB = 'PayClub'; + public const GATEWAY_NAME_PAY_COM = 'PayCom'; + public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards'; public const GATEWAY_NAME_PAYEEZY = 'Payeezy'; @@ -1623,6 +1625,8 @@ public static function from(array $data = []): self return PayCash::from($data); case 'PayClub': return PayClub::from($data); + case 'PayCom': + return PayCom::from($data); case 'PayEcards': return PayEcards::from($data); case 'Payeezy': diff --git a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php index b2a44f68..fb6455c6 100644 --- a/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php +++ b/src/Model/GetPayoutRequestPaymentInstrumentsResponse.php @@ -286,6 +286,8 @@ class GetPayoutRequestPaymentInstrumentsResponse implements JsonSerializable public const GATEWAY_NAME_PAY_CLUB = 'PayClub'; + public const GATEWAY_NAME_PAY_COM = 'PayCom'; + public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards'; public const GATEWAY_NAME_PAYEEZY = 'Payeezy'; diff --git a/src/Model/PayCom.php b/src/Model/PayCom.php new file mode 100644 index 00000000..5a50c2b8 --- /dev/null +++ b/src/Model/PayCom.php @@ -0,0 +1,84 @@ + 'PayCom', + ] + $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(): PayComCredentials + { + return $this->fields['credentials']; + } + + public function setCredentials(PayComCredentials|array $credentials): static + { + if (!($credentials instanceof PayComCredentials)) { + $credentials = PayComCredentials::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; + } +} diff --git a/src/Model/PayComCredentials.php b/src/Model/PayComCredentials.php new file mode 100644 index 00000000..85495260 --- /dev/null +++ b/src/Model/PayComCredentials.php @@ -0,0 +1,56 @@ +setApiKey($data['apiKey']); + } + } + + public static function from(array $data = []): self + { + return new self($data); + } + + public function getApiKey(): string + { + return $this->fields['apiKey']; + } + + public function setApiKey(string $apiKey): static + { + $this->fields['apiKey'] = $apiKey; + + return $this; + } + + public function jsonSerialize(): array + { + $data = []; + if (array_key_exists('apiKey', $this->fields)) { + $data['apiKey'] = $this->fields['apiKey']; + } + + return $data; + } +} diff --git a/src/Model/PayoutRequestAllocations.php b/src/Model/PayoutRequestAllocations.php index 86540e69..b20a2111 100644 --- a/src/Model/PayoutRequestAllocations.php +++ b/src/Model/PayoutRequestAllocations.php @@ -666,6 +666,8 @@ class PayoutRequestAllocations implements JsonSerializable public const GATEWAY_NAME_PAY_CLUB = 'PayClub'; + public const GATEWAY_NAME_PAY_COM = 'PayCom'; + public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards'; public const GATEWAY_NAME_PAYEEZY = 'Payeezy'; diff --git a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php index 25f72af9..0c12defd 100644 --- a/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php +++ b/src/Model/PickInstructionGatewayAcquirerWeightsWeightedList.php @@ -284,6 +284,8 @@ class PickInstructionGatewayAcquirerWeightsWeightedList implements JsonSerializa public const GATEWAY_NAME_PAY_CLUB = 'PayClub'; + public const GATEWAY_NAME_PAY_COM = 'PayCom'; + public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards'; public const GATEWAY_NAME_PAYEEZY = 'Payeezy'; diff --git a/src/Model/Transaction.php b/src/Model/Transaction.php index 847d8c6c..16e4fcad 100644 --- a/src/Model/Transaction.php +++ b/src/Model/Transaction.php @@ -342,6 +342,8 @@ class Transaction implements JsonSerializable public const GATEWAY_NAME_PAY_CLUB = 'PayClub'; + public const GATEWAY_NAME_PAY_COM = 'PayCom'; + public const GATEWAY_NAME_PAY_ECARDS = 'PayEcards'; public const GATEWAY_NAME_PAYEEZY = 'Payeezy';