Skip to content

Commit

Permalink
[Configuration] Ensure ConfigureController works on PS 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinMitchell committed Jul 5, 2024
1 parent 3915ebd commit 86efeb7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ services:
expose:
- '8080'
- '8443'
image: 'bitnami/prestashop:8.1.3'
image: 'bitnami/prestashop:8.0.4'
links:
- mariadb
- btcpayserver
Expand Down
2 changes: 1 addition & 1 deletion modules/btcpay/btcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct()
{
$this->name = 'btcpay';
$this->tab = 'payments_gateways';
$this->version = '6.1.4';
$this->version = '6.1.5';
$this->author = 'BTCPay Server';
$this->ps_versions_compliancy = ['min' => Constants::MINIMUM_PS_VERSION, 'max' => _PS_VERSION_];
$this->controllers = ['payment', 'validation', 'webhook'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use BTCPay\Server\Data\ValidateApiKey;
use BTCPayServer\Client\ApiKey;
use Exception;
use PrestaShop\PrestaShop\Core\Domain\Configuration\ShopConfigurationInterface;
use PrestaShop\PrestaShop\Core\Form\FormHandlerInterface;
use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;
use PrestaShopBundle\Security\Annotation\AdminSecurity;
Expand Down Expand Up @@ -293,6 +294,16 @@ public function validateAPIKeyAction(Request $request): Response
return $this->redirectToRoute('admin_btcpay_configure');
}

protected function getConfiguration(): ShopConfigurationInterface
{
// Fallback in case 8.0 is used // TODO: Remove once we make 8.1.0 the minimum
if (\version_compare(\_PS_VERSION_, '8.1.0', '<')) {
return $this->configuration;
}

return parent::getConfiguration();
}

/**
* @throws Exception
*/
Expand Down

0 comments on commit 86efeb7

Please sign in to comment.