diff --git a/admin/controller/extension/payment/coingate.php b/admin/controller/extension/payment/coingate.php index 9480653..53cdc1b 100755 --- a/admin/controller/extension/payment/coingate.php +++ b/admin/controller/extension/payment/coingate.php @@ -178,4 +178,9 @@ private function validate() return !$this->error; } + + public function install() { + $this->load->model('extension/payment/coingate'); + $this->model_extension_payment_coingate->install(); + } } diff --git a/admin/model/extension/payment/coingate.php b/admin/model/extension/payment/coingate.php new file mode 100644 index 0000000..c4123f2 --- /dev/null +++ b/admin/model/extension/payment/coingate.php @@ -0,0 +1,18 @@ +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; + "); + } + } +} diff --git a/catalog/controller/extension/payment/coingate.php b/catalog/controller/extension/payment/coingate.php index 42a2298..16905c5 100755 --- a/catalog/controller/extension/payment/coingate.php +++ b/catalog/controller/extension/payment/coingate.php @@ -50,7 +50,7 @@ public function confirm() $order = \CoinGate\Merchant\Order::createOrFail(array( 'order_id' => $order['order_id'], - 'price_amount' => number_format($order['total'] * $this->currency->getvalue($order['currency_code']), 2, '.', ''), + 'price_amount' => number_format($order['total'] * $this->currency->getvalue($order['currency_code']), 8, '.', ''), 'price_currency' => $order['currency_code'], 'receive_currency' => $this->config->get('coingate_receive_currency'), 'cancel_url' => $this->url->link('extension/payment/coingate/cancel', '', $this->config->get('config_secure')), diff --git a/install.xml b/install.xml new file mode 100644 index 0000000..5d71920 --- /dev/null +++ b/install.xml @@ -0,0 +1,14 @@ + + + CoinGate + coningate + 3.1.3 + Ivan + + + + request->post['code']) != 3)]]> + request->post['code']), array(3, 4)))]]> + + +