Skip to content

Commit

Permalink
Merge pull request #242 from Invertus/BUGFIX/bad-payment-executing
Browse files Browse the repository at this point in the history
BUGFIX Wrong payment method logic executing
  • Loading branch information
MarijusCoding authored Dec 18, 2024
2 parents be27a34 + fa5efbf commit 6fb1501
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions views/js/front/hosted-templates/hosted_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $(document).ready(function () {

if (!isSaferPayMethodSelected) {
event.target.submit();
return;
}

var selectedCardMethod = $(this).find("[name=saved_card_method]").val();
Expand Down
7 changes: 7 additions & 0 deletions views/js/front/opc/onepagecheckoutps/hosted_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 6fb1501

Please sign in to comment.