Skip to content

Commit

Permalink
Version fix
Browse files Browse the repository at this point in the history
  • Loading branch information
krzGablo committed Jan 23, 2024
1 parent ced024e commit 1773509
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions Model/ApiFacade/Refund/RefundApiFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(TpayInterface $tpay)
{
$this->tpay = $tpay;
$this->createRefundOriginApiInstance($tpay);
$this->createOpenApiInstance($tpay->getOpenApiClientId(), $tpay->getOpenApiPassword(), !$tpay->useSandboxMode());
$this->createOpenApiInstance($tpay);
}

public function makeRefund(InfoInterface $payment, float $amount)
Expand Down Expand Up @@ -54,11 +54,10 @@ private function createRefundOriginApiInstance(TpayInterface $tpay)
}
}

private function createOpenApiInstance(string $clientId, string $apiPassword, bool $isProd)
private function createOpenApiInstance(TpayInterface $tpay)
{
try {
$this->openApi = new OpenApi($clientId, $apiPassword, $isProd);
$this->openApi->authorization();
$this->openApi = new OpenApi($tpay);
$this->useOpenApi = true;
} catch (Exception $exception) {
$this->openApi = null;
Expand Down
3 changes: 1 addition & 2 deletions Model/ApiFacade/Transaction/TransactionApiFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ private function createOpenApiInstance(TpayInterface $tpay)
}

try {
$this->openApi = new OpenApi($tpay->getOpenApiClientId(), $tpay->getOpenApiPassword(), !$tpay->useSandboxMode());
$this->openApi->authorization();
$this->openApi = new OpenApi($tpay);
$this->useOpenApi = true;
} catch (Exception $exception) {
$this->openApi = null;
Expand Down

0 comments on commit 1773509

Please sign in to comment.