File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
app/code/Magento/AuthorizenetAcceptjs/view/adminhtml Expand file tree Collapse file tree 2 files changed +14
-12
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
+ ['Magento_AuthorizenetAcceptjs/js/payment-form'],
13
+ function(Authorizenet) {
14
+ var config = <?= /* @noEscape */ $ block ->getPaymentConfig () ?> ,
15
+ form = "#payment_form_<?= $ block ->escapeJs ($ block ->escapeHtml ($ block ->getMethodCode ())) ?> ";
16
+
17
+ new Authorizenet(config, form);
18
+ });
19
+ //]]>
20
+ </script>
Original file line number Diff line number Diff line change 8
8
] , function ( AuthorizenetAcceptjs , $ ) {
9
9
'use strict' ;
10
10
11
- return function ( data , element ) {
12
- var $form = $ ( element ) ,
13
- config = data . config ;
11
+ return function ( config , element ) {
12
+ var $form = $ ( element ) ;
14
13
15
14
config . active = $form . length > 0 && ! $form . is ( ':hidden' ) ;
16
15
new AuthorizenetAcceptjs ( config ) ;
You can’t perform that action at this time.
0 commit comments