Skip to content

Commit ff7e7ce

Browse files
committed
MC-41704: PP PayLater for Checkout Page
1 parent 7b7072a commit ff7e7ce

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public function getJsLayout()
8787
$componentAttributes = $this->jsLayout['components']['payLater']['config']['attributes'] ?? [];
8888
$config['attributes'] = array_replace($this->getStyleAttributesConfig(), $componentAttributes);
8989
$config['attributes']['data-pp-placement'] = $this->placement;
90-
$config['sdkUrl'] = $this->getPayPalSdkUrl();
9190

9291
$this->jsLayout = [
9392
'components' => [

app/code/Magento/Paypal/Model/PayLaterCheckoutConfigProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ public function __construct(PayLaterConfig $payLaterConfig, SdkUrl $sdkUrl)
4242
*/
4343
public function getConfig()
4444
{
45-
$attributes = $this->payLaterConfig->getStyleConfig(PayLaterConfig::CHECKOUT_PAYMENT_PLACEMENT);
45+
$attributes = $this->payLaterConfig
46+
->getSectionConfig(PayLaterConfig::CHECKOUT_PAYMENT_PLACEMENT, PayLaterConfig::CONFIG_KEY_STYLE);
4647
$attributes['data-pp-placement'] = self::PLACEMENT;
4748

4849
$config['payment']['paypalPayLater']['enabled'] = $this->payLaterConfig->isEnabled(

app/code/Magento/Paypal/view/frontend/web/js/view/paylater-checkout.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,16 @@ define([
1616
quote
1717
) {
1818
'use strict';
19-
20-
const payLaterEnabled = window.checkoutConfig.payment.paypalPayLater.enabled;
21-
const payLaterConfig = window.checkoutConfig.payment.paypalPayLater.config;
19+
var payLaterEnabled = window.checkoutConfig.payment.paypalPayLater.enabled,
20+
payLaterConfig = window.checkoutConfig.payment.paypalPayLater.config;
2221

2322
return Component.extend({
2423
defaults: {
2524
template: 'Magento_Paypal/paylater',
2625
sdkUrl: payLaterEnabled ? payLaterConfig.sdkUrl : '',
2726
attributes: payLaterConfig.attributes,
2827
amount: ko.observable(),
29-
style: 'margin-bottom: 10px;',
28+
style: 'margin-bottom: 10px;'
3029
},
3130

3231
/**
@@ -45,7 +44,8 @@ define([
4544
* Update amount
4645
*/
4746
updateAmount: function () {
48-
const amount = this.amount;
47+
var amount = this.amount;
48+
4949
quote.totals.subscribe(function (newValue) {
5050
amount(newValue['base_grand_total']);
5151
});

app/code/Magento/Paypal/view/frontend/web/js/view/paylater-default.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ define([
2424
sdkUrl: '',
2525
attributes: {},
2626
amount: ko.observable(),
27-
style: '',
27+
style: ''
2828
},
2929
paypal: null,
3030

@@ -36,7 +36,7 @@ define([
3636
initialize: function () {
3737
this._super();
3838

39-
if ( this.sdkUrl !== '') {
39+
if (this.sdkUrl !== '') {
4040
this.loadPayPalSdk(this.sdkUrl)
4141
.then(this._setPayPalObject.bind(this));
4242
}
@@ -72,6 +72,6 @@ define([
7272
*/
7373
_setPayPalObject: function (paypal) {
7474
this.paypal = paypal;
75-
},
75+
}
7676
});
7777
});

app/code/Magento/Paypal/view/frontend/web/js/view/paylater-product.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ define([
1212
], function (
1313
$,
1414
ko,
15-
Component,
15+
Component
1616
) {
1717
'use strict';
1818

0 commit comments

Comments
 (0)