Skip to content

Commit

Permalink
make setupFields more resilient on ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
slogsdon committed Jan 28, 2021
1 parent e62226c commit 92f7b2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $allow_card_saving = Mage::getModel('hps_transit/payment')->getConfigData('allow
};

if (window.TransITMagentoAdmin.setupFields) {
window.TransITMagentoAdmin.setupFields();
window.TransITMagentoAdmin.loadLibrary(window.TransITMagentoAdmin.setupFields);
}
})();
//]]>
Expand Down
4 changes: 4 additions & 0 deletions js/transit/admin-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
return;
}

if (document.querySelector(window.TransITMagentoAdmin.options.iframeTargets.cardNumber + ' iframe') !== null) {
return;
}

GlobalPayments.configure(window.TransITMagentoAdmin.options.credentials);

window.TransITMagentoAdmin.cardForm = GlobalPayments.ui.form({
Expand Down

0 comments on commit 92f7b2b

Please sign in to comment.