File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
view/frontend/web/js/in-context Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 9
9
namespace Magento \Paypal \Block \PayLater ;
10
10
11
11
use Magento \Checkout \Block \Checkout \LayoutProcessorInterface ;
12
+ use Magento \Framework \App \ObjectManager ;
12
13
use Magento \Paypal \Model \PayLaterConfig ;
13
14
use Magento \Paypal \Model \SdkUrl ;
14
15
use Magento \Paypal \Model \Config as PaypalConfig ;
@@ -48,9 +49,9 @@ public function __construct(
48
49
SdkUrl $ sdkUrl ,
49
50
PaypalConfig $ paypalConfig
50
51
) {
51
- $ this ->payLaterConfig = $ payLaterConfig ;
52
- $ this ->sdkUrl = $ sdkUrl ;
53
- $ this ->paypalConfig = $ paypalConfig ;
52
+ $ this ->payLaterConfig = $ payLaterConfig ;
53
+ $ this ->sdkUrl = $ sdkUrl ;
54
+ $ this ->paypalConfig = $ paypalConfig ;
54
55
}
55
56
56
57
/**
Original file line number Diff line number Diff line change @@ -25,14 +25,19 @@ define([
25
25
exports : 'paypal'
26
26
}
27
27
} ,
28
+ attributes : {
29
+ 'paypalSdk' : dataAttributes
30
+ } ,
28
31
29
32
/**
30
33
* Add attributes under Paypal SDK Script tag
31
34
*/
32
- onNodeCreated : function ( node ) {
33
- $ . each ( dataAttributes , function ( index , elem ) {
34
- node . setAttribute ( index , elem ) ;
35
- } ) ;
35
+ onNodeCreated : function ( node , config , name ) {
36
+ if ( config . attributes && config . attributes [ name ] ) {
37
+ $ . each ( dataAttributes , function ( index , elem ) {
38
+ node . setAttribute ( index , elem ) ;
39
+ } ) ;
40
+ }
36
41
}
37
42
} ) ;
38
43
You can’t perform that action at this time.
0 commit comments