Skip to content

Commit

Permalink
Merge pull request #9 from logeecom-dev/master
Browse files Browse the repository at this point in the history
Fix missing method in integration tests, update to the stable integration core version
  • Loading branch information
m1k3lm authored Jan 11, 2024
2 parents f4b271a + 5116b10 commit abeec2b
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 15 deletions.
6 changes: 5 additions & 1 deletion Services/BusinessLogic/OrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@ public function getStatisticsOrderIds(int $page, int $limit = 5000): array
}

/**
* @param Webhook $webhook
* @param string $status
* @param int|null $reasonCode
* @param string|null $message
* @inheritdoc
*
* @throws Exception
*/
public function updateStatus(Webhook $webhook, string $status): void
public function updateStatus(Webhook $webhook, string $status, ?int $reasonCode = null, ?string $message = null): void
{
switch ($status) {
case Order::STATE_PENDING_PAYMENT:
Expand Down
103 changes: 103 additions & 0 deletions Setup/DatabaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Sequra\Core\Setup;

use Magento\Framework\DB\Ddl\Table;

/**
* Class DatabaseHandler
*
Expand All @@ -25,6 +27,107 @@ public function getInstaller()
return $this->installer;
}

public function createEntityTable(string $tableName): void
{
$entityTable = $this->installer->getTable($tableName);

if (!$this->installer->getConnection()->isTableExists($entityTable)) {
$entityTable = $this->installer->getConnection()
->newTable($this->installer->getTable($tableName))
->addColumn(
'id',
Table::TYPE_INTEGER,
null,
[
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true,
'auto_increment' => true,
],
'Id'
)
->addColumn(
'type',
Table::TYPE_TEXT,
128,
['nullable' => false],
'Type'
)
->addColumn(
'index_1',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index1'
)
->addColumn(
'index_2',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index2'
)
->addColumn(
'index_3',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index3'
)
->addColumn(
'index_4',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index4'
)
->addColumn(
'index_5',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index5'
)
->addColumn(
'index_6',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index6'
)
->addColumn(
'index_7',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index7'
)
->addColumn(
'index_8',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index8'
)
->addColumn(
'index_9',
Table::TYPE_TEXT,
255,
['default' => null, 'nullable' => true],
'Index9'
)
->addColumn(
'data',
Table::TYPE_TEXT,
Table::MAX_TEXT_SIZE,
['nullable' => false],
'Data'
);

$this->installer->getConnection()->createTable($entityTable);
}
}
/**
* Drops Sequra entity table.
*
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"minimum-stability": "stable",
"require": {
"php": ">=7.2",
"sequra/integration-core": "dev-CR-SET-04-01",
"sequra/integration-core": "1.0.11",
"ext-json": "*"
},
"repositories": [
Expand Down
18 changes: 8 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ define([
).done(function () {
if (window.checkoutConfig.payment.sequra_payment.showSeQuraCheckoutAsHostedPage) {
const hppPageUrl = new URL(
window.checkoutConfig.payment.sequra_payment.sequraCheckoutHostedPage
window.checkoutConfig.payment.sequra_payment.sequraCheckoutHostedPage
);

hppPageUrl.searchParams.append("sequra_product", data.additional_data.sequra_product);
hppPageUrl.searchParams.append(
"sequra_campaign", data.additional_data.sequra_campaign || ''
"sequra_campaign", data.additional_data.sequra_campaign || ''
);

window.location.replace(hppPageUrl.href);
Expand Down Expand Up @@ -238,10 +238,14 @@ define([

loadSeQuraScript: function () {
if (typeof Sequra === "undefined") {
let products = [];
window.checkoutConfig.payment.sequra_payment.widget_settings.products.forEach((product) => {
products.push(product.id);
});
var sequraConfigParams = {
merchant: window.checkoutConfig.payment.sequra_payment.widget_settings.merchant,
assetKey: window.checkoutConfig.payment.sequra_payment.widget_settings.assetKey,
products: window.checkoutConfig.payment.sequra_payment.widget_settings.products,
products: products,
scriptUri: window.checkoutConfig.payment.sequra_payment.widget_settings.scriptUri,
decimalSeparator: window.checkoutConfig.payment.sequra_payment.widget_settings.decimalSeparator,
thousandSeparator: window.checkoutConfig.payment.sequra_payment.widget_settings.thousandSeparator,
Expand Down

0 comments on commit abeec2b

Please sign in to comment.