lyra / plugin-magento

An open source plugin that links Magento based e-commerce websites to PayZen secure payment gateway developed by Lyra Network.
https://lyra.com/fr/guides/magento/
Open Software License 3.0
10 stars 12 forks source link

Redirect to PayZen gateway in vanilla JS #26

Closed VincentMarmiesse closed 5 months ago

VincentMarmiesse commented 2 years ago

Hello,

This template is causing some random errors like

require is not defined

and IMO it's better and faster to use a vanilla JS redirection.

nabil509 commented 2 years ago

Hi @VincentMarmiesse,

Thank you for the pull request.

We preferred the use of jQuery to produce code widely compatible. We used the Magento recommendations to load the dependency and use it for the redirection. Please see here: https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_init.html#init_script

We could not reproduce the error you mention. Please give us more context to reproduce.

xi-ao commented 2 years ago

I'm having similar issue when JS merging is enabled. @nabil509 Have you tested your module with a configuration such as:

[
    'system' => [
        'default' => [
            'dev' => [
                'js' => [
                    'minify_files' => '1',
                    'move_script_to_bottom' => '1'
                ],
                'css' => [
                    'merge_css_files' => '1',
                    'minify_files' => '1'
                ],
                'static' => [
                    'sign' => '1'
                ],
                'template' => [
                    'minify_html' => '1'
                ]
            ]
        ]
    ],
];

Edit: And with the iframe mode enabled too.