Skip to content

Commit

Permalink
Merge pull request #183 from buckaroo-it/BP-3758-Add-blik-configs-int…
Browse files Browse the repository at this point in the history
…o-upgrade-file

BP-3758-Add-blik-configs-into-upgrade-file
  • Loading branch information
vegimcarkaxhija authored Sep 11, 2024
2 parents 0620afe + c21013f commit 802a461
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion upgrade/upgrade-4.4.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

use Buckaroo\PrestaShop\Src\Config\Config;
use Buckaroo\PrestaShop\Src\Repository\RawOrderingRepository;

if (!defined('_PS_VERSION_')) {
exit;
Expand Down Expand Up @@ -43,6 +43,19 @@ function upgrade_module_4_4_0($object)
$insertQuery = 'INSERT INTO ' . _DB_PREFIX_ . 'bk_payment_methods (' . implode(', ', $keys) . ') VALUES ("' . implode('", "', $values) . '")';
Db::getInstance()->execute($insertQuery);

$paymentMethodId = Db::getInstance()->Insert_ID();

// Insert default configuration for Knaken Settle
$blikConfig = [
'mode' => 'off'
];

$configInsertQuery = 'INSERT INTO ' . _DB_PREFIX_ . 'bk_configuration (configurable_id, value) VALUES (' . (int)$paymentMethodId . ', \'' . pSQL(json_encode($blikConfig)) . '\')';
Db::getInstance()->execute($configInsertQuery);

$orderingRepository = new RawOrderingRepository();
$orderingRepository->insertCountryOrdering();

Db::getInstance()->execute('UPDATE ' . _DB_PREFIX_ . 'bk_payment_methods SET label = "Riverty" WHERE name = "afterpay"');

return true;
Expand Down

0 comments on commit 802a461

Please sign in to comment.