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 99namespace Magento \Paypal \Block \PayLater ;
1010
1111use Magento \Checkout \Block \Checkout \LayoutProcessorInterface ;
12+ use Magento \Framework \App \ObjectManager ;
1213use Magento \Paypal \Model \PayLaterConfig ;
1314use Magento \Paypal \Model \SdkUrl ;
1415use Magento \Paypal \Model \Config as PaypalConfig ;
@@ -48,9 +49,9 @@ public function __construct(
4849 SdkUrl $ sdkUrl ,
4950 PaypalConfig $ paypalConfig
5051 ) {
51- $ this ->payLaterConfig = $ payLaterConfig ;
52- $ this ->sdkUrl = $ sdkUrl ;
53- $ this ->paypalConfig = $ paypalConfig ;
52+ $ this ->payLaterConfig = $ payLaterConfig ;
53+ $ this ->sdkUrl = $ sdkUrl ;
54+ $ this ->paypalConfig = $ paypalConfig ;
5455 }
5556
5657 /**
Original file line number Diff line number Diff line change @@ -25,14 +25,19 @@ define([
2525 exports : 'paypal'
2626 }
2727 } ,
28+ attributes : {
29+ 'paypalSdk' : dataAttributes
30+ } ,
2831
2932 /**
3033 * Add attributes under Paypal SDK Script tag
3134 */
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+ }
3641 }
3742 } ) ;
3843
You can’t perform that action at this time.
0 commit comments