File tree Expand file tree Collapse file tree 3 files changed +19
-15
lines changed
app/code/Magento/AuthorizenetAcceptjs Expand file tree Collapse file tree 3 files changed +19
-15
lines changed Original file line number Diff line number Diff line change 7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Store:etc/config.xsd" >
9
9
<default >
10
+ <dev >
11
+ <js >
12
+ <minify_exclude >
13
+ <authorizenet_acceptjs >\.authorize\.net/v1/Accept</authorizenet_acceptjs >
14
+ </minify_exclude >
15
+ </js >
16
+ </dev >
10
17
<payment >
11
18
<authorizenet_acceptjs >
12
19
<active >0</active >
Original file line number Diff line number Diff line change 4
4
*/
5
5
6
6
var config = {
7
- map : {
8
- '*' : {
9
- acceptjssandbox : 'https://jstest.authorize.net/v1/Accept.js' ,
10
- acceptjs : 'https://js.authorize.net/v1/Accept.js'
7
+ shim : {
8
+ acceptjs : {
9
+ exports : 'Accept'
10
+ } ,
11
+ acceptjssandbox : {
12
+ exports : 'Accept'
11
13
}
14
+ } ,
15
+ paths : {
16
+ acceptjssandbox : 'https://jstest.authorize.net/v1/Accept' ,
17
+ acceptjs : 'https://js.authorize.net/v1/Accept'
12
18
}
13
19
} ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ define([
16
16
dependency = 'acceptjssandbox' ;
17
17
}
18
18
19
- require ( [ dependency ] , function ( ) {
19
+ require ( [ dependency ] , function ( accept ) {
20
20
var $body = $ ( 'body' ) ;
21
21
22
22
/*
@@ -26,16 +26,7 @@ define([
26
26
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
27
27
*/
28
28
$body . on ( 'handshake.acceptjs' , function ( ) {
29
- /*
30
- * Accept.js doesn't return the library when loading
31
- * and requirejs "shim" can't be used because it only works with the "paths" config option
32
- * and we can't use "paths" because require will try to load ".min.js" in production
33
- * and that doesn't work because it doesn't exist
34
- * and we can't add a query string to force a URL because accept.js will reject it
35
- * and we can't include it locally because they check in the script before loading more scripts
36
- * So, we use the global version as "shim" would
37
- */
38
- deferred . resolve ( window . Accept ) ;
29
+ deferred . resolve ( accept ) ;
39
30
$body . off ( 'handshake.acceptjs' ) ;
40
31
} ) ;
41
32
} ,
You can’t perform that action at this time.
0 commit comments