File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
app/code/Magento/AuthorizenetAcceptjs/view/base Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 4
4
*/
5
5
6
6
var config = {
7
- shim : {
8
- acceptjs : {
9
- exports : 'Accept'
10
- } ,
11
- acceptjssandbox : {
12
- exports : 'Accept'
7
+ map : {
8
+ '*' : {
9
+ acceptjssandbox : 'https://jstest.authorize.net/v1/Accept.js' ,
10
+ acceptjs : 'https://js.authorize.net/v1/Accept.js'
13
11
}
14
- } ,
15
- paths : {
16
- acceptjssandbox : 'https://jstest.authorize.net/v1/Accept' ,
17
- acceptjs : 'https://js.authorize.net/v1/Accept'
18
12
}
19
13
} ;
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 ( accept ) {
19
+ require ( [ dependency ] , function ( ) {
20
20
var $body = $ ( 'body' ) ;
21
21
22
22
/*
@@ -26,7 +26,16 @@ 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
- deferred . resolve ( accept ) ;
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 ) ;
30
39
$body . off ( 'handshake.acceptjs' ) ;
31
40
} ) ;
32
41
} ,
You can’t perform that action at this time.
0 commit comments