From 8c2af33d4013358f178d6431fc5272a95ef55a65 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 11 Jan 2024 12:44:45 +0100 Subject: [PATCH] Fix Open API configuration --- Api/TpayInterface.php | 2 ++ Model/ApiFacade/Transaction/TransactionApiFacade.php | 2 +- Model/Tpay.php | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Api/TpayInterface.php b/Api/TpayInterface.php index a18b0b3..264794e 100644 --- a/Api/TpayInterface.php +++ b/Api/TpayInterface.php @@ -32,6 +32,8 @@ public function getApiKey(): ?string; public function getSecurityCode(): ?string; + public function getOpenApiClientId(): ?string; + public function getOpenApiSecurityCode(): ?string; public function getMerchantId(): ?int; diff --git a/Model/ApiFacade/Transaction/TransactionApiFacade.php b/Model/ApiFacade/Transaction/TransactionApiFacade.php index c750cd5..1281c43 100755 --- a/Model/ApiFacade/Transaction/TransactionApiFacade.php +++ b/Model/ApiFacade/Transaction/TransactionApiFacade.php @@ -96,7 +96,7 @@ private function createOriginApiInstance(TpayInterface $tpay) private function createOpenApiInstance(TpayInterface $tpay) { try { - $this->openApi = new OpenApi($tpay->getClientId(), $tpay->getOpenApiPassword(), !$tpay->useSandboxMode()); + $this->openApi = new OpenApi($tpay->getOpenApiClientId(), $tpay->getOpenApiPassword(), !$tpay->useSandboxMode()); $this->openApi->authorization(); $this->useOpenApi = true; } catch (Exception $exception) { diff --git a/Model/Tpay.php b/Model/Tpay.php index b5c8c63..c12805c 100755 --- a/Model/Tpay.php +++ b/Model/Tpay.php @@ -219,9 +219,9 @@ public function getMerchantId(): ?int return (int) $this->getConfigData('merchant_id'); } - public function getOpenApiClientId() + public function getOpenApiClientId(): ?string { - return $this->getConfigData('open_api_client_id') ?? ''; + return $this->getConfigData('open_api_client_id'); } public function getSecurityCode(): ?string