diff --git a/modules/btcpay/btcpay.php b/modules/btcpay/btcpay.php index 24d799d..8ea1302 100644 --- a/modules/btcpay/btcpay.php +++ b/modules/btcpay/btcpay.php @@ -117,12 +117,8 @@ public function install(): bool return false; } - if (null === ($repository = $this->get('prestashop.module.btcpay.repository.install')) || false === $repository instanceof TableRepository) { - $this->addModuleErrors(['Expected a TableRepository repository, but received null/something else']); - - return false; - } - + // Create required tables + $repository = new TableRepository($this->get('doctrine.dbal.default_connection')); if (!empty($errors = (new Tables($repository))->install())) { $this->addModuleErrors($errors); $this->uninstall(); diff --git a/modules/btcpay/src/Repository/TableRepository.php b/modules/btcpay/src/Repository/TableRepository.php index 6b2cf8a..7a68db2 100644 --- a/modules/btcpay/src/Repository/TableRepository.php +++ b/modules/btcpay/src/Repository/TableRepository.php @@ -12,15 +12,10 @@ class TableRepository */ private $connection; - /** - * @var string - */ - private $prefix; - - public function __construct(Connection $connection, string $prefix) + public function __construct(Connection $connection) { $this->connection = $connection; - $this->prefix = $prefix; + $this->prefix = \_DB_PREFIX_; } /**