Skip to content

Commit

Permalink
Fix handling notifications (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilleszczak2 authored Mar 4, 2021
1 parent f0e5501 commit 8cf4b59
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions upload/catalog/controller/extension/payment/paynow.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class ControllerExtensionPaymentPaynow extends Controller
private $version = "1.0.4";
private $apiClient = null;

private $apiKey;
private $signatureKey;

public function __construct($registry)
{
parent::__construct($registry);
Expand All @@ -28,12 +31,12 @@ private function initApiClient()

$this->load->model("setting/setting");
$isSandboxEnabled = (int)$this->config->get("payment_paynow_sandbox_enabled");
$apiKey = $this->isSandboxEnabled ? $this->config->get("payment_paynow_sandbox_api_key") : $this->config->get("payment_paynow_production_api_key");
$signatureKey = $this->isSandboxEnabled ? $this->config->get("payment_paynow_sandbox_signature_key") : $this->config->get("payment_paynow_production_signature_key");
$this->apiKey = $isSandboxEnabled ? $this->config->get("payment_paynow_sandbox_api_key") : $this->config->get("payment_paynow_production_api_key");
$this->signatureKey = $isSandboxEnabled ? $this->config->get("payment_paynow_sandbox_signature_key") : $this->config->get("payment_paynow_production_signature_key");

$this->apiClient = new \Paynow\Client(
$apiKey,
$signatureKey,
$this->apiKey,
$this->signatureKey,
$isSandboxEnabled ? \Paynow\Environment::SANDBOX : \Paynow\Environment::PRODUCTION,
"OpenCart-" . VERSION . "/Plugin-" . $this->version
);
Expand Down

0 comments on commit 8cf4b59

Please sign in to comment.