Skip to content

Commit

Permalink
Merge pull request #3 from crypto-com/v1_0_1
Browse files Browse the repository at this point in the history
Update to v1.0.1
  • Loading branch information
thomasmktong-cryptocom committed Apr 12, 2021
2 parents 3b0df31 + 4a7f535 commit 17ee0d1
Show file tree
Hide file tree
Showing 34 changed files with 83 additions and 85 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,5 +1,5 @@

Copyright 2018 - 2020, Foris Limited ("Crypto.com").
Copyright 2018 - 2021, Foris Limited ("Crypto.com").

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions classes/cryptopayhelper.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions classes/cryptopaytransaction.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions classes/index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions controllers/admin/AdminCryptoPayLogController.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions controllers/admin/AdminCryptoPayPaymentController.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions controllers/admin/AdminCryptoPaySettingController.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions controllers/admin/index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions controllers/front/index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
29 changes: 17 additions & 12 deletions controllers/front/validation.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down Expand Up @@ -251,16 +251,21 @@ public function displayAjaxGetPayment()
$payment['id_crypto_pay'] = (int)$payment['id_crypto_pay'];
$cryptopaytransactions = new CryptoPayTransactions();
$cryptopaytransactions->updateTransaction($payment);
$url = Context::getContext()->shop->getBaseURL(true) .
'/index.php?controller=order-confirmation&id_cart=' .
$this->context->cart->id . '&id_module=' . $this->module->id .
'&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key;

if (Configuration::get('PS_REWRITING_SETTINGS')) {
$url = (new Link())->getPageLink("order-confirmation", $this->ssl, $this->context->language->id);
$url .= '?id_cart=' . $this->context->cart->id . '&id_module=' . $this->module->id .
'&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key;
}

$url = Context::getContext()->link->getPageLink('order-confirmation');

$query = parse_url($url, PHP_URL_QUERY);

if ($query) {
$url .= '&id_cart=' .
$this->context->cart->id . '&id_module=' . $this->module->id .
'&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key;
} else {
$url .= '?id_cart=' .
$this->context->cart->id . '&id_module=' . $this->module->id .
'&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key;
}

die(
Tools::jsonEncode(
array(
Expand Down
4 changes: 2 additions & 2 deletions controllers/front/webhook.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions controllers/index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
13 changes: 3 additions & 10 deletions cryptopay.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand All @@ -43,15 +43,14 @@ public function __construct()
{
$this->name = 'cryptopay';
$this->tab = 'payments_gateways';
$this->version = '1.0.0';
$this->version = '1.0.1';
$this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
$this->author = 'Crypto.com';
$this->controllers = array('validation');
$this->is_eu_compatible = 1;
$this->currencies = true;
$this->module_key = '7a10b1c0440ed9b43192fd15f8188f31';
$this->currencies_mode = 'checkbox';
$this->limited_currencies = array('USD', 'EUR');
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Crypto.com Pay');
Expand Down Expand Up @@ -102,12 +101,6 @@ public function install()
) {
return false;
}
if (!Currency::exists('USD', 0) &&
!Currency::exists('EUR', 0)) {
$this->_errors[] = $this->l('Crypto.com Payment Method is only available
when one of this (USD, EUR) currency is activated.');
return false;
}
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions sql/index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions sql/install.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions views/img/index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions views/index.php
@@ -1,6 +1,6 @@
<?php
/*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -17,7 +17,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/

Expand Down
4 changes: 2 additions & 2 deletions views/templates/admin/admin-order.tpl
@@ -1,5 +1,5 @@
{*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*}

Expand Down
4 changes: 2 additions & 2 deletions views/templates/admin/cancel_order.tpl
@@ -1,5 +1,5 @@
{*
* 2018-2020 Foris Limited ("Crypto.com")
* 2018-2021 Foris Limited ("Crypto.com")
*
* NOTICE OF LICENSE
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*
* @author Crypto.com <pay@crypto.com>
* @copyright 2018-2020 Foris Limited ("Crypto.com")
* @copyright 2018-2021 Foris Limited ("Crypto.com")
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*}
{$status|escape:'htmlall':'UTF-8'}
Expand Down

0 comments on commit 17ee0d1

Please sign in to comment.