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

Removed the displayPaymentEU hook #88

Merged
merged 3 commits into from
Nov 15, 2023
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
16 changes: 1 addition & 15 deletions modules/btcpay/btcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct()
{
$this->name = 'btcpay';
$this->tab = 'payments_gateways';
$this->version = '6.0.1';
$this->version = '6.0.2';
$this->author = 'BTCPay Server';
$this->ps_versions_compliancy = ['min' => Constants::MINIMUM_PS_VERSION, 'max' => _PS_VERSION_];
$this->controllers = ['payment', 'validation', 'webhook'];
Expand Down Expand Up @@ -357,20 +357,6 @@ public function hookDisplayOrderDetail(array $params): ?string
}
}

public function hookDisplayPaymentEU(): array
{
// If the module is not active, abort
if (!$this->active) {
return [];
}

return [
'cta_text' => $this->name,
'logo' => Media::getMediaPath(_PS_MODULE_DIR_ . $this->name . '/views/images/bitcoin.png'),
'action' => $this->context->link->getModuleLink($this->name, 'payment', [], true),
];
}

/**
* Hooks on prestashop payment returns
*
Expand Down
1 change: 0 additions & 1 deletion modules/btcpay/src/Installer/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function install(): array
{
if (!$this->module->registerHook('displayAdminOrderMainBottom')
|| !$this->module->registerHook('displayOrderDetail')
|| !$this->module->registerHook('displayPaymentEU')
|| !$this->module->registerHook('paymentReturn')
|| !$this->module->registerHook('paymentOptions')
|| !$this->module->registerHook('actionCartSave')) {
Expand Down
19 changes: 19 additions & 0 deletions modules/btcpay/upgrade/upgrade-6.0.2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use PrestaShop\PrestaShop\Core\Module\ModuleInterface;

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

/**
* @param BTCpay|ModuleInterface|mixed $module
*/
function upgrade_module_6_0_2(mixed $module): bool
{
if (!$module instanceof BTCPay) {
throw new LogicException('Received invalid module');
}

return $module->unregisterHook('displayPaymentEU');
}