Skip to content

Commit

Permalink
Removed the displayPaymentEU hook
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinMitchell committed Nov 15, 2023
1 parent c9eecba commit 70f263b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
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');
}

0 comments on commit 70f263b

Please sign in to comment.