Skip to content

Commit

Permalink
Blik payment method insert
Browse files Browse the repository at this point in the history
  • Loading branch information
gentiprenaj committed Jul 8, 2024
1 parent 49f0529 commit 76fef16
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions upgrade/upgrade-4.4.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* It is available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this file
*
* @author Buckaroo.nl <[email protected]>
* @copyright Copyright (c) Buckaroo B.V.
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

use Buckaroo\PrestaShop\Src\Config\Config;

if (!defined('_PS_VERSION_')) {
exit;
}

/**
* @return mixed
* @throws Exception
*/
function upgrade_module_4_4_0($object)
{
$blikData = [
'name' => 'blik',
'label' => 'Blik',
'icon' => 'Blik.svg',
'template' => '',
'is_payment_method' => '1',
];

$keys = array_keys($blikData);
$values = array_map(function ($value) {
return pSQL($value);
}, array_values($blikData));

$insertQuery = 'INSERT INTO ' . _DB_PREFIX_ . 'bk_payment_methods (' . implode(', ', $keys) . ') VALUES ("' . implode('", "', $values) . '")';
Db::getInstance()->execute($insertQuery);
return true;
}

0 comments on commit 76fef16

Please sign in to comment.