From 7d8040e550a93a2387797c9ab0b93e8a63ff1e0e Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Wed, 18 Dec 2024 09:23:54 +0200 Subject: [PATCH 1/2] [BUGFIX] Fixed to execute right payment logic when not safer payment method selected. Also made compatibility with OPC --- views/js/front/hosted-templates/hosted_fields.js | 1 + views/js/front/opc/onepagecheckoutps/hosted_fields.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/views/js/front/hosted-templates/hosted_fields.js b/views/js/front/hosted-templates/hosted_fields.js index 72ec9527..63bfc9d2 100755 --- a/views/js/front/hosted-templates/hosted_fields.js +++ b/views/js/front/hosted-templates/hosted_fields.js @@ -34,6 +34,7 @@ $(document).ready(function () { if (!isSaferPayMethodSelected) { event.target.submit(); + return; } var selectedCardMethod = $(this).find("[name=saved_card_method]").val(); diff --git a/views/js/front/opc/onepagecheckoutps/hosted_fields.js b/views/js/front/opc/onepagecheckoutps/hosted_fields.js index 2b8162f7..a4a1c647 100644 --- a/views/js/front/opc/onepagecheckoutps/hosted_fields.js +++ b/views/js/front/opc/onepagecheckoutps/hosted_fields.js @@ -41,6 +41,13 @@ $('body').on('submit', '[id^=pay-with-][id$=-form] form', function (event) { return; } + var isSaferPayMethodSelected = $('[data-module-name*="saferpayofficial"]:checked').length; + + if (!isSaferPayMethodSelected) { + event.target.submit(); + return; + } + $.ajax(saferpay_official_ajax_url, { method: 'POST', data: { From fa5efbf7374f340d0093c0fddfda3fcd77367f02 Mon Sep 17 00:00:00 2001 From: MarijusCoding Date: Wed, 18 Dec 2024 09:30:43 +0200 Subject: [PATCH 2/2] [BUGFIX] changelog.md --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index a6fa6ea9..d4895f9d 100755 --- a/changelog.md +++ b/changelog.md @@ -181,3 +181,4 @@ - Fixed issue with JSON API Password escaping HTML entities - Added new payment methods: Blik, ClickToPay - Fixed performance issues when loading "Payments" tab in Back office. +- Fixed issue when saferpay logic is executing on other payment methods which is not saferpay