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

[Configuration] Ensure ConfigureController works on PS 8.0 #140

Merged
merged 1 commit into from
Jul 5, 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
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