Skip to content

Commit

Permalink
[BUGFIX] Fixed to execute right payment logic when not safer payment …
Browse files Browse the repository at this point in the history
…method selected. Also made compatibility with OPC
  • Loading branch information
MarijusCoding committed Dec 18, 2024
1 parent be27a34 commit 7d8040e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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 7d8040e

Please sign in to comment.