Skip to content

Commit

Permalink
Merge pull request #12 from sequra/fix/php7.4-compatibility
Browse files Browse the repository at this point in the history
Fix compatibilitiy with PHP 7.4 and add plugin_version to order request
  • Loading branch information
m1k3lm committed Mar 6, 2024
2 parents e472b23 + af39ed3 commit 2bc05fd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Model/Api/Builders/CreateOrderRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ private function getPlatform(): array
return [
'name' => 'magento2',
'version' => $this->productMetadata->getVersion(),
'integration_version' => $this->moduleResource->getDbVersion('Sequra_Core'),
'plugin_version' => $this->moduleResource->getDbVersion('Sequra_Core'),
'uname' => php_uname(),
'db_name' => !empty($connectionData['model']) ? $connectionData['model'] : 'mysql',
'db_version' => $this->sqlVersionProvider->getSqlVersion(),
Expand Down
3 changes: 1 addition & 2 deletions Services/BusinessLogic/Utility/SeQuraTranslationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public function __construct(Reader $moduleDirReader, Csv $csv, Session $session)
*/
public function translate(string $text, ...$arguments): Phrase
{
$locale = $this->session->getUser() ?
$this->session->getUser()->getInterfaceLocale() : null;
$locale = ($user = $this->session->getUser()) ? $user->getInterfaceLocale(): null;
if ($locale && !self::$englishTranslation) {
$filePath = $this->moduleDirReader->getModuleDir('i18n', 'Sequra_Core') . '/' . $locale . '.csv';
if (!file_exists($filePath)) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"minimum-stability": "stable",
"require": {
"php": ">=7.2",
"php": ">=7.4",
"sequra/integration-core": "v1.0.11",
"ext-json": "*"
},
Expand Down
4 changes: 2 additions & 2 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 @@ -237,6 +237,10 @@ define([
},

loadSeQuraScript: function () {
if (!window.checkoutConfig.payment.sequra_payment.widget_settings.hasOwnProperty('merchant')) {
return;
}

if (typeof Sequra === "undefined") {
let products = [];
window.checkoutConfig.payment.sequra_payment.widget_settings.products.forEach((product) => {
Expand Down

0 comments on commit 2bc05fd

Please sign in to comment.