File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
app/code/Magento/AuthorizenetAcceptjs/view/adminhtml/templates/payment Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change 6
6
7
7
/** @var Magento\AuthorizenetAcceptjs\Block\Payment $block */
8
8
?>
9
- <script type="text/x-magento-init">
10
- {
11
- "#payment_form_<?= $ block ->escapeJs ($ block ->escapeHtml ($ block ->getMethodCode ())) ?> ": {
12
- "Magento_AuthorizenetAcceptjs/js/payment-form": {
13
- "config": <?= /* @noEscape */ $ block ->getPaymentConfig () ?>
14
- }
15
- }
16
- }
17
- </script>
9
+ <script>
10
+ //<![CDATA[
11
+ require(
12
+ [
13
+ 'Magento_AuthorizenetAcceptjs/js/authorizenet',
14
+ 'jquery',
15
+ 'domReady!'
16
+ ], function(AuthorizenetAcceptjs, $) {
17
+ var config = <?= /* @noEscape */ $ block ->getPaymentConfig () ?> ,
18
+ form = $('#payment_form_<?= /* @noEscape */ $ block ->escapeJs ($ block ->escapeHtml ($ block ->getMethodCode ())) ?> ');
19
+
20
+ config.active = form.length > 0 && !form.is(':hidden');
21
+ new AuthorizenetAcceptjs(config);
22
+ });
23
+ //]]>
24
+ </script>
You can’t perform that action at this time.
0 commit comments