Skip to content

Commit 17d2027

Browse files
committed
Merge remote-tracking branch 'origin/AC-1228' into gl_pr_paypal_nov11_2021
2 parents 6a1c1f6 + 452d3fc commit 17d2027

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

app/code/Magento/Paypal/Block/PayLater/LayoutProcessor.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace Magento\Paypal\Block\PayLater;
1010

1111
use Magento\Checkout\Block\Checkout\LayoutProcessorInterface;
12+
use Magento\Framework\App\ObjectManager;
1213
use Magento\Paypal\Model\PayLaterConfig;
1314
use Magento\Paypal\Model\SdkUrl;
1415
use 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
/**

app/code/Magento/Paypal/view/frontend/web/js/in-context/paypal-sdk.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)