Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commits for module validation #98

Merged
merged 6 commits into from
Feb 28, 2024
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ docker-compose.override.yml
# Ignore files in the module that are added via `make`
/modules/btcpay/LICENSE
/modules/btcpay/README.md
/modules/btcpay/docs/README.md

# We dont care about the lib/vendor folder
/modules/btcpay/lib/
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ build: ## Build the bastard binary file
# Copy the license to the module
@cp ./LICENSE "$(MODULE_FOLDER)/$(MODULE)"

# Copy the README to the module
# Copy the README to the module root and docs
@cp ./README.md "$(MODULE_FOLDER)/$(MODULE)"
@cp ./README.md "$(MODULE_FOLDER)/$(MODULE)/docs"

# Zip the module
@cd $(MODULE_FOLDER) \
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpoffice/phpspreadsheet": "^1.24.1",
"prestashop/autoindex": "^2.1",
"prestashop/php-dev-tools": "^4.3.0",
"prestashop/prestashop": "8.1.x-dev",
"roave/security-advisories": "dev-latest",
Expand Down
11 changes: 6 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions modules/btcpay/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
<Files *.php>
order allow,deny
deny from all
</Files>
</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
<Files *.php>
Require all denied
</Files>
</IfModule>
9 changes: 5 additions & 4 deletions modules/btcpay/btcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,25 @@ public function __construct()
{
$this->name = 'btcpay';
$this->tab = 'payments_gateways';
$this->version = '6.1.1';
$this->version = '6.1.2';
$this->author = 'BTCPay Server';
$this->ps_versions_compliancy = ['min' => Constants::MINIMUM_PS_VERSION, 'max' => _PS_VERSION_];
$this->controllers = ['payment', 'validation', 'webhook'];
$this->is_eu_compatible = true;
$this->bootstrap = true;
$this->module_key = 'aec3ab8084e8e626bdcbda75d2ab39ee';

$this->currencies = true;
$this->currencies_mode = 'radio';

parent::__construct();

$this->displayName = $this->trans('BTCPay Server', [], 'Modules.Btcpay.Admin');
$this->description = $this->trans('Accept crypto payments via BTCPay Server.', [], 'Modules.Btcpay.Front');
$this->displayName = $this->trans('BTCPay Server', [], 'Modules.Btcpay.Admin');
$this->description = $this->trans('Accept crypto payments via BTCPay Server.', [], 'Modules.Btcpay.Front');
$this->confirmUninstall = $this->trans('Are you sure that you want to uninstall this module? Past purchases and order states will be kept, but your configuration will be removed.', [], 'Modules.Btcpay.Front');

$this->configuration = new Configuration();
$this->versioning = new Versioning();
$this->versioning = new Versioning();

// Process any and all alerts/warnings
$this->displayModuleWarnings();
Expand Down
9 changes: 5 additions & 4 deletions modules/btcpay/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions modules/btcpay/config/index.php
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}

class AdminConfigureBTCPayController extends ModuleAdminController
{
/**
Expand Down
11 changes: 11 additions & 0 deletions modules/btcpay/controllers/admin/index.php
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 11 additions & 0 deletions modules/btcpay/controllers/front/index.php
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 4 additions & 0 deletions modules/btcpay/controllers/front/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
use BTCPay\Server\Factory;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!defined('_PS_VERSION_')) {
exit;
}

class BTCPayPaymentModuleFrontController extends ModuleFrontController
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use BTCPay\Server\Client;
use PrestaShop\PrestaShop\Adapter\Configuration;

if (!defined('_PS_VERSION_')) {
exit;
}

class BTCPayValidationModuleFrontController extends ModuleFrontController
{
/**
Expand Down
4 changes: 4 additions & 0 deletions modules/btcpay/controllers/front/webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use PrestaShop\PrestaShop\Adapter\Configuration;
use Symfony\Component\HttpFoundation\Request;

if (!defined('_PS_VERSION_')) {
exit;
}

class BTCPayWebhookModuleFrontController extends \ModuleFrontController
{
/**
Expand Down
11 changes: 11 additions & 0 deletions modules/btcpay/controllers/index.php
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 11 additions & 0 deletions modules/btcpay/docs/index.php
Original file line number Diff line number Diff line change
@@ -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;
Binary file added modules/btcpay/docs/readme_en.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions modules/btcpay/src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use BTCPayServer\Client\InvoiceCheckoutOptions;

if (!\defined('_PS_VERSION_')) {
exit;
}

class Constants
{
// Version information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Throwable;

if (!\defined('_PS_VERSION_')) {
exit;
}

/**
* @ModuleActivated(moduleName="btcpay", redirectRoute="admin_module_manage")
*/
Expand Down
11 changes: 11 additions & 0 deletions modules/btcpay/src/Controller/Admin/Improve/Payment/index.php
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 11 additions & 0 deletions modules/btcpay/src/Controller/Admin/Improve/index.php
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 11 additions & 0 deletions modules/btcpay/src/Controller/Admin/index.php
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 11 additions & 0 deletions modules/btcpay/src/Controller/index.php
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 4 additions & 0 deletions modules/btcpay/src/Entity/BitcoinPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace BTCPay\Entity;

if (!\defined('_PS_VERSION_')) {
exit;
}

/**
* phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
*/
Expand Down
11 changes: 11 additions & 0 deletions modules/btcpay/src/Entity/index.php
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 4 additions & 0 deletions modules/btcpay/src/Exception/BTCPayException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace BTCPay\Exception;

if (!\defined('_PS_VERSION_')) {
exit;
}

class BTCPayException extends \RuntimeException
{
}
11 changes: 11 additions & 0 deletions modules/btcpay/src/Exception/index.php
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 4 additions & 0 deletions modules/btcpay/src/Factory/CustomerMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

use BTCPay\Repository\CustomerThreadRepository;

if (!\defined('_PS_VERSION_')) {
exit;
}

class CustomerMessage
{
/**
Expand Down
Loading