Skip to content

Commit

Permalink
+new version 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
feyzullahdemir committed Jun 8, 2022
1 parent 94c69c9 commit 6fa414c
Show file tree
Hide file tree
Showing 31 changed files with 101 additions and 42 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added upload/.DS_Store
Binary file not shown.
Binary file added upload/admin/.DS_Store
Binary file not shown.
Binary file added upload/admin/controller/.DS_Store
Binary file not shown.
Binary file added upload/admin/controller/extension/.DS_Store
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions upload/admin/controller/extension/payment/paywithiyzico.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

class ControllerExtensionPaymentPaywithiyzico extends Controller {

private $module_version = '1.3';
private $module_product_name = 'eleven-1.3';
private $module_version = '1.5';
private $module_product_name = 'eleven-1.5';

private $error = array();

Expand Down
Binary file added upload/admin/model/.DS_Store
Binary file not shown.
Binary file added upload/admin/model/extension/.DS_Store
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions upload/admin/model/extension/payment/paywithiyzico.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
class ModelExtensionPaymentPaywithiyzico extends Model {
private $module_version = VERSION;
private $module_product_name = 'eleven-1.3';
private $module_product_name = 'eleven-1.5';


public function install() {
Expand Down Expand Up @@ -162,4 +162,4 @@ public function curlPost($json,$authorizationData,$url) {
return $result;
}

}
}
Binary file added upload/admin/view/.DS_Store
Binary file not shown.
Binary file added upload/admin/view/template/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added upload/catalog/.DS_Store
Binary file not shown.
Binary file added upload/catalog/controller/.DS_Store
Binary file not shown.
Binary file added upload/catalog/controller/extension/.DS_Store
Binary file not shown.
Binary file not shown.
26 changes: 23 additions & 3 deletions upload/catalog/controller/extension/payment/paywithiyzico.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ControllerExtensionPaymentPaywithiyzico extends Controller {
private $module_version = VERSION;
private $module_product_name = 'eleven-1.3';
private $module_product_name = 'eleven-1.5';


private function setcookieSameSite($name, $value, $expire, $path, $domain, $secure, $httponly) {
Expand Down Expand Up @@ -75,7 +75,17 @@ public function index() {

/* Order Detail */
$paywithiyzico = new stdClass;
$paywithiyzico->locale = $this->language->get('code');

$language = $this->config->get('payment_iyzico_language');
$str_language = mb_strtolower($language);

if(empty($str_language) or $str_language == 'null')
{
$paywithiyzico->locale = $this->language->get('code');
}else {
$paywithiyzico->locale = $str_language;
}

$paywithiyzico->conversationId = $order_id;
$paywithiyzico->price = $this->priceParser($this->itemPriceSubTotal($products) * $order_info['currency_value']);
$paywithiyzico->paidPrice = $this->priceParser($order_info['total'] * $order_info['currency_value']);
Expand Down Expand Up @@ -417,6 +427,16 @@ public function successPage() {
$this->document->addStyle('catalog/view/javascript/paywithiyzico/paywithiyzico_success.css');

$data['continue'] = $this->url->link('account/order', '', true);
$language = $this->config->get('payment_iyzico_language');
$str_language = mb_strtolower($language);

if(empty($str_language) or $str_language == 'null')
{
$locale = $this->language->get('code');
}else {
$locale = $str_language;
}
$data['locale'] = $locale;

$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
Expand Down Expand Up @@ -532,4 +552,4 @@ public function injectPwiLogoCss($route, &$data = false, &$output) {
$output = str_replace($hook,$js,$output);
}

}
}
Binary file added upload/catalog/model/.DS_Store
Binary file not shown.
Binary file added upload/catalog/model/extension/.DS_Store
Binary file not shown.
Binary file not shown.
95 changes: 65 additions & 30 deletions upload/catalog/model/extension/payment/paywithiyzico.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,79 @@
class ModelExtensionPaymentPaywithiyzico extends Model {

public function getMethod($address, $total) {
$currency_code = $this->session->data['currency'];
if(!empty($currency_code) and $currency_code == 'TRY' or $currency_code == 'try')
{
$payment_paywithiyzico_geo_zone_id = $this->config->get('payment_paywithiyzico_geo_zone_id');
$payment_paywithiyzico_geo_zone_id = $this->db->escape($payment_paywithiyzico_geo_zone_id);
$address_country_id = $this->db->escape($address['country_id']);
$address_zone_id = $this->db->escape($address['zone_id']);

$payment_paywithiyzico_geo_zone_id = $this->config->get('payment_paywithiyzico_geo_zone_id');
$payment_paywithiyzico_geo_zone_id = $this->db->escape($payment_paywithiyzico_geo_zone_id);
$address_country_id = $this->db->escape($address['country_id']);
$address_zone_id = $this->db->escape($address['zone_id']);
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone_to_geo_zone` WHERE `geo_zone_id` = '" . $payment_paywithiyzico_geo_zone_id . "' AND `country_id` = '" . $address_country_id . "' AND (`zone_id` = '" . $address_zone_id . "' OR `zone_id` = '0')");

$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone_to_geo_zone` WHERE `geo_zone_id` = '" . $payment_paywithiyzico_geo_zone_id . "' AND `country_id` = '" . $address_country_id . "' AND (`zone_id` = '" . $address_zone_id . "' OR `zone_id` = '0')");
if ($this->config->get('payment_paywithiyzico_total') > $total) {
$status = false;
} elseif (!$this->config->get('payment_paywithiyzico_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}

if ($this->config->get('payment_paywithiyzico_total') > $total) {
$status = false;
} elseif (!$this->config->get('payment_paywithiyzico_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}
$language = $this->config->get('payment_iyzico_language');
$str_language = mb_strtolower($language);
$this->load->language('extension/payment/paywithiyzico');

$method_data = array();

$this->load->language('extension/payment/paywithiyzico');
if(empty($str_language) or $str_language == 'null')
{
$title_language = $this->language->get('pwi_img_title'). " " .$this->language->get('pwi_title');

}elseif ($str_language == 'tr') {

$title_language = '<img width="20%" src="admin/view/image/payment/pay-with-iyzico-tr.svg"/>'.''.'iyzico ile Öde';
}else {

$title_language = '<img width="20%" src="admin/view/image/payment/pay-with-iyzico.svg"/>'.''.'Pay with iyzico';
}

$method_data = array();



if ($status) {
$method_data = array(
'code' => 'paywithiyzico',
'title' => $title_language,
'terms' => '',
'sort_order' => $this->config->get('payment_paywithiyzico_sort_order')
);
}

return $method_data;

}

if ($status) {
$method_data = array(
'code' => 'paywithiyzico',
'title' => $this->language->get('pwi_img_title'). " " .$this->language->get('pwi_title'),
'terms' => '',
'sort_order' => $this->config->get('payment_paywithiyzico_sort_order')
);
}

return $method_data;
}

private function paywithiyzicoMultipLangTitle($title) {

$this->load->language('extension/payment/paywithiyzico');

$this->load->language('extension/payment/iyzico');
$language = $this->config->get('payment_iyzico_language');
$str_language = mb_strtolower($language);

if(empty($str_language) or $str_language == 'null')
{
$title_language = $this->language->get('code');
}else {
$title_language = $str_language;
}


if($title) {

$parser = explode('|',$title);
Expand All @@ -50,7 +85,7 @@ private function paywithiyzicoMultipLangTitle($title) {
foreach ($parser as $key => $parse) {
$result = explode('=',$parse);

if($this->language->get('code') == $result[0]) {
if($title_language == $result[0]) {
$new_title = $result[1];
break;
}
Expand Down Expand Up @@ -245,7 +280,7 @@ public function curlPost($json,$authorization_data,$url) {

public function insertCardUserKey($customer_id,$card_user_key,$api_key) {

$insertCard = $this->db->query("INSERT INTO `" . DB_PREFIX . "paywithiyzico_card` SET
$insertCard = $this->db->query("INSERT INTO `" . DB_PREFIX . "paywithiyzico_card` SET
`customer_id` = '" . $this->db->escape($customer_id) . "',
`card_user_key` = '" . $this->db->escape($card_user_key) . "',
`api_key` = '" . $this->db->escape($api_key) . "'");
Expand All @@ -270,9 +305,9 @@ public function findUserCardKey($customer_id,$api_key) {

public function insertIyzicoOrder($order) {

$insertOrder = $this->db->query("INSERT INTO `" . DB_PREFIX . "paywithiyzico_order` SET
$insertOrder = $this->db->query("INSERT INTO `" . DB_PREFIX . "paywithiyzico_order` SET
`payment_id` = '" . $this->db->escape($order->payment_id) . "',
`order_id` = '" . $this->db->escape($order->order_id) . "',
`order_id` = '" . $this->db->escape($order->order_id) . "',
`total_amount` = '" . $this->db->escape($order->total_amount) . "',
`status` = '" . $this->db->escape($order->status) . "'");

Expand Down Expand Up @@ -361,4 +396,4 @@ public function getUserCreateDate($user_id) {



}
}
Binary file added upload/catalog/view/.DS_Store
Binary file not shown.
Binary file added upload/catalog/view/theme/.DS_Store
Binary file not shown.
Binary file added upload/catalog/view/theme/default/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ header }}
<div id="error-not-found" class="container">

<div class="row">{{ column_left }}
{% if column_left and column_right %}
{% set class = 'col-sm-6' %}
Expand All @@ -13,7 +13,11 @@
<div class="table-responsive">

<div class="successPayment">
{% if locale =='tr'%}
<h1>Ödemeniz Alındı. </h1>
{% else %}
<h1>Your Payment Received. </h1>
{% endif %}
<div>
<img src="{{success_icon}}" width="64" height="64" />
</div>
Expand All @@ -32,7 +36,7 @@
</tr>
</thead>
<tbody>

{% for product in products %}
<tr>
<td class="text-left"><a href="{{ product.href }}">{{ product.name }}</a> {% for option in product.option %} <br />
Expand All @@ -55,17 +59,17 @@
</tr>
{% endfor %}
</tbody>

<tfoot>

{% for total in totals %}
<tr>
<td colspan="4" class="text-right"><strong>{{ total.title }}:</strong></td>
<td class="text-right">{{ total.text }}</td>
</tr>
{% endfor %}
</tfoot>

</table>
</div>

Expand Down

0 comments on commit 6fa414c

Please sign in to comment.