From 8420b098ac66aa7af083af41e7ccba1d8095267c Mon Sep 17 00:00:00 2001 From: Mehmet Selim Dil Date: Thu, 18 Feb 2021 17:58:04 +0300 Subject: [PATCH] hot fix --- .../controller/extension/payment/paywithiyzico.php | 12 +++++++----- .../model/extension/payment/paywithiyzico.php | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/upload/catalog/controller/extension/payment/paywithiyzico.php b/upload/catalog/controller/extension/payment/paywithiyzico.php index a23dd3a..8410c0d 100644 --- a/upload/catalog/controller/extension/payment/paywithiyzico.php +++ b/upload/catalog/controller/extension/payment/paywithiyzico.php @@ -26,7 +26,7 @@ private function setcookieSameSite($name, $value, $expire, $path, $domain, $secu } } - public function index() { + public function index() { $cookieControl = false; @@ -64,6 +64,7 @@ public function index() { $secret_key = $this->config->get('payment_iyzico_secret_key'); $payment_source = "OPENCART-".$this->module_version."|".$this->module_product_name."|".$this->config->get('payment_paywithiyzico_design'); + $user_create_date = $this->model_extension_payment_paywithiyzico->getUserCreateDate($user_id); $this->session->data['conversation_id'] = $order_id; @@ -83,9 +84,10 @@ public function index() { $paywithiyzico->basketId = $order_id; $paywithiyzico->paymentGroup = "PRODUCT"; $paywithiyzico->callbackUrl = $this->url->link('extension/payment/paywithiyzico/getcallback', '', true); - $paywithiyzico->cancelUrl = $this->url->link('extension/payment/paywithiyzico/getcallback', '', true); + $paywithiyzico->cancelUrl = $this->config->get('config_url'); $paywithiyzico->paymentSource = $payment_source; + if ($paywithiyzico->paidPrice === 0) { return false; } @@ -162,8 +164,8 @@ public function index() { $data['pwi_redirect'] = $form_response->payWithIyzicoPageUrl; - return $this->load->view('extension/payment/paywithiyzico_form',$data); - } + return $this->load->view('extension/payment/paywithiyzico_form',$data); + } public function getCallBack() { @@ -520,4 +522,4 @@ private function getIpAdress() { return $ip_address; } -} +} \ No newline at end of file diff --git a/upload/catalog/model/extension/payment/paywithiyzico.php b/upload/catalog/model/extension/payment/paywithiyzico.php index dc8d87b..745e23d 100644 --- a/upload/catalog/model/extension/payment/paywithiyzico.php +++ b/upload/catalog/model/extension/payment/paywithiyzico.php @@ -202,7 +202,7 @@ public function hashGenerate($pki,$api_key,$secret_key,$random_value) { public function createFormInitializeDetailRequest($json,$authorization_data) { - $url = "https://sandbox-api.iyzipay.com"; + $url = $this->config->get('payment_iyzico_api_url'); $url = $url.'/payment/iyzipos/checkoutform/auth/ecom/detail'; return $this->curlPost($json,$authorization_data,$url); @@ -212,7 +212,7 @@ public function createFormInitializeDetailRequest($json,$authorization_data) { public function createFormInitializeRequest($json,$authorization_data) { - $url = "https://sandbox-api.iyzipay.com"; + $url = $this->config->get('payment_iyzico_api_url'); $url = $url.'/payment/pay-with-iyzico/initialize';