first commit

This commit is contained in:
2025-01-06 20:47:25 +01:00
commit 3bdbd78c2f
25591 changed files with 3586440 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../../../');
exit;

View File

@@ -0,0 +1,30 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_1_2($module)
{
$query = 'SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "external_id"';
if (Db::getInstance()->executeS($query) == false) {
Db::getInstance()->execute('
ALTER TABLE ' . _DB_PREFIX_ . 'paynow_payments
ADD external_id VARCHAR(50) NOT NULL AFTER order_reference');
}
return Configuration::updateValue('PAYNOW_ORDER_CONFIRMED_STATE', 2) &&
Configuration::updateValue('PAYNOW_ORDER_REJECTED_STATE', 6) &&
Configuration::updateValue('PAYNOW_ORDER_ERROR_STATE', 8) &&
$module->registerHook('displayOrderDetail');
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_3_0($module)
{
if (!$module->registerHook('actionOrderStatusPostUpdate') ||
!$module->registerHook('actionOrderSlipAdd') ||
!$module->registerHook('displayAdminOrderTop') ||
!Configuration::updateValue('PAYNOW_REFUNDS_ENABLED', 1) ||
!Configuration::updateValue('PAYNOW_REFUNDS_AFTER_STATUS_CHANGE_ENABLED', 0)) {
return false;
}
return true;
}

View File

@@ -0,0 +1,24 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_3_1($module)
{
if (!$module->registerHook('displayAdminAfterHeader')) {
return false;
}
return true;
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_3_2($module)
{
if (!$module->registerHook('displayAdminAfterHeader') ||
!Configuration::updateValue('PAYNOW_SEPARATE_PAYMENT_METHODS', 0)) {
return false;
}
return true;
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_3_3()
{
return Configuration::updateValue('PAYNOW_USE_CLASSIC_RETURN_URL', 0);
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_3_4()
{
return Configuration::updateValue('PAYNOW_SEND_ORDER_ITEMS', 0);
}

View File

@@ -0,0 +1,22 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_3_6()
{
Configuration::updateValue('PAYNOW_PAYMENT_VALIDITY_TIME_ENABLED', 0);
Configuration::updateValue('PAYNOW_PAYMENT_VALIDITY_TIME', 86400);
return true;
}

View File

@@ -0,0 +1,33 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_3_7()
{
try {
$sql = "
DELETE t1, t2 FROM `" . _DB_PREFIX_ . "order_state` t1 INNER JOIN `" . _DB_PREFIX_ . "order_state_lang` t2
WHERE t1.id_order_state <> (SELECT * FROM(SELECT max(id_order_state) FROM `" . _DB_PREFIX_ . "order_state` WHERE module_name = 'paynow')tblTmp)
AND t1.module_name = 'paynow'
AND t1.id_order_state = t2.id_order_state;";
if (Db::getInstance()->execute($sql)) {
return (int)Db::getInstance()->Insert_ID();
}
} catch (PrestaShopDatabaseException $exception) {
PaynowLogger::error($exception->getMessage());
}
return true;
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_4_0()
{
$sql = "
DELETE t1 FROM " . _DB_PREFIX_ . "paynow_payments t1
JOIN " . _DB_PREFIX_ . "paynow_payments t2
ON t2.id_payment = t1.id_payment
AND t2.modified_at > t1.modified_at ";
return Db::getInstance()->execute($sql) &&
Configuration::updateValue('PAYNOW_ORDER_ABANDONED_STATE', Configuration::get('PAYNOW_ORDER_INITIAL_STATE')) &&
Configuration::updateValue('PAYNOW_ORDER_EXPIRED_STATE', Configuration::get('PAYNOW_ORDER_INITIAL_STATE')) &&
Configuration::updateValue('PAYNOW_ORDER_REJECTED_STATE', Configuration::get('PAYNOW_ORDER_INITIAL_STATE'));
}

View File

@@ -0,0 +1,25 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_5_0($module)
{
return $module->registerHook('displayAdminOrder') &&
$module->unregisterHook('displayAdminOrderTop') &&
Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments`
ADD INDEX `index_order_cart_payment_reference` (`id_order`, `id_cart`, `id_payment`, `order_reference`)"
);
}

View File

@@ -0,0 +1,37 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_6_0($module)
{
try {
Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` DROP INDEX index_order_cart_payment_reference;"
);
} catch (PrestaShopDatabaseException $exception) {
PaynowLogger::error($exception->getMessage() . ' ' . $exception->getTraceAsString());
}
return Configuration::updateValue('PAYNOW_ORDER_ABANDONED_STATE', 1) &&
Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments`
ADD `total` DECIMAL(20,6) NOT NULL DEFAULT '0.000000'
AFTER `status`"
) &&
Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments`
ADD INDEX `index_order_cart_payment_reference_external_id` (`id_order`, `id_cart`, `id_payment`, `order_reference`, `external_id`)"
);
}

View File

@@ -0,0 +1,24 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_6_11($module)
{
return Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments`
ADD `locked` TINYINT(1) NOT NULL DEFAULT 0
AFTER `total`"
);
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_6_12($module)
{
try {
Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments`
ADD `locked` TINYINT(1) NOT NULL DEFAULT 0
AFTER `total`"
);
} catch (PrestaShopDatabaseException $exception) {
}
return true;
}

View File

@@ -0,0 +1,36 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_6_2($module)
{
try {
Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` DROP INDEX index_order_cart_payment_reference;"
);
Db::getInstance()-> execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` DROP INDEX index_order_cart_payment_reference_external_id;"
);
Db::getInstance()-> execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments`
ADD INDEX `index_order_cart_payment_reference_external_id` (`id_order`, `id_cart`, `id_payment`, `order_reference`, `external_id`)"
);
} catch (PrestaShopDatabaseException $exception) {
PaynowLogger::error($exception->getMessage() . ' ' . $exception->getTraceAsString());
}
return Configuration::updateValue('PAYNOW_CREATE_ORDER_STATE', 1) &&
Configuration::updateValue('PAYNOW_ORDER_ABANDONED_STATE', Configuration::get('PAYNOW_ORDER_INITIAL_STATE'));
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License (MIT)
* that is bundled with this package in the file LICENSE.md.
*
* @author mElements S.A.
* @copyright mElements S.A.
* @license MIT License
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_6_3($module)
{
try {
Db::getInstance()->execute(
"ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments`
ADD `total` DECIMAL(20,6) NOT NULL DEFAULT '0.000000'
AFTER `status`"
);
} catch (PrestaShopDatabaseException $exception) {
}
return true;
}