Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions install.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>CoinGate</name>
<code>coningate</code>
<version>3.1.3</version>
<author>Ivan</author>
<!-- Allow 4 characters in form validation -->
<file path="admin/controller/localisation/currency.php">
<operation>
<search><![CDATA[if (utf8_strlen($this->request->post['code']) != 3)]]></search>
<add position="replace"><![CDATA[if (!in_array(utf8_strlen($this->request->post['code']), array(3, 4)))]]></add>
</operation>
</file>
</modification>
2 changes: 1 addition & 1 deletion upload/admin/controller/extension/payment/coingate.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once(DIR_SYSTEM . 'library/coingate/coingate-php/init.php');
require_once(DIR_SYSTEM . 'library/vendor/coingate/init.php');

class ControllerExtensionPaymentCoingate extends Controller {
private $error = array();
Expand Down
13 changes: 13 additions & 0 deletions upload/admin/model/extension/payment/coingate.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ public function install() {
) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;
");

// Modify the currency table to allow 4-character currency code
$query = $this->db->query("
SELECT character_maximum_length
FROM information_schema.columns
WHERE table_name = '" . DB_PREFIX . "currency' and column_name = 'code';
");
if ((int)$query->row['character_maximum_length'] < 4) {
$this->db->query("
ALTER TABLE `" . DB_PREFIX . "currency`
MODIFY `code` VARCHAR(4) COLLATE utf8_general_ci NOT NULL;
");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a check if table is 3 charters should be done before editing table

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add it if you think it's needed, but "modifying" it from 4 to 4 simply won't make any changes, so I thought it wasn't necessary.

@stranac stranac Jul 2, 2021

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the check

$this->load->model('setting/setting');

$defaults = array();
Expand Down
6 changes: 3 additions & 3 deletions upload/catalog/controller/extension/payment/coingate.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

require_once(DIR_SYSTEM . 'library/coingate/coingate-php/init.php');
require_once(DIR_SYSTEM . 'library/coingate/version.php');
require_once(DIR_SYSTEM . 'library/vendor/coingate/init.php');
require_once(DIR_SYSTEM . 'library/vendor/coingate/version.php');

class ControllerExtensionPaymentCoingate extends Controller
{
Expand Down Expand Up @@ -40,7 +40,7 @@ public function checkout()
'callback_url' => $this->url->link('extension/payment/coingate/callback', array('cg_token' => $token), true),
'success_url' => $this->url->link('extension/payment/coingate/success', array('cg_token' => $token), true),
'title' => $this->config->get('config_meta_title') . ' Order #' . $order_info['order_id'],
'description' => join($description, ', '),
'description' => join(', ', $description),
'token' => $token
));

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.