File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
app/code/Magento/Paypal/Block/PayLater Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 12
12
use Magento \Paypal \Model \PayLaterConfig ;
13
13
use Magento \Paypal \Model \SdkUrl ;
14
14
use Magento \Paypal \Model \Config as PaypalConfig ;
15
+ use Magento \Framework \App \ObjectManager ;
15
16
16
17
/**
17
18
* PayPal PayLater component block
@@ -56,14 +57,15 @@ public function __construct(
56
57
PayLaterConfig $ payLaterConfig ,
57
58
SdkUrl $ sdkUrl ,
58
59
array $ data = [],
59
- PaypalConfig $ paypalConfig
60
+ PaypalConfig $ paypalConfig = null
60
61
) {
61
62
parent ::__construct ($ context , $ data );
62
63
$ this ->payLaterConfig = $ payLaterConfig ;
63
64
$ this ->sdkUrl = $ sdkUrl ;
64
65
$ this ->placement = $ data ['placement ' ] ?? '' ;
65
66
$ this ->position = $ data ['position ' ] ?? '' ;
66
- $ this ->paypalConfig = $ paypalConfig ;
67
+ $ this ->paypalConfig = $ paypalConfig ?: ObjectManager::getInstance ()
68
+ ->get (PaypalConfig::class);
67
69
}
68
70
69
71
/**
Original file line number Diff line number Diff line change @@ -54,14 +54,14 @@ public function __construct(
54
54
}
55
55
56
56
/**
57
- * { @inheritdoc}
57
+ * @inheritdoc
58
58
*/
59
59
public function process ($ jsLayout )
60
60
{
61
61
if (!$ this ->payLaterConfig ->isEnabled (PayLaterConfig::CHECKOUT_PAYMENT_PLACEMENT )) {
62
62
unset($ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]['billing-step ' ]
63
- ['children ' ]['payment ' ]['children ' ]['payments-list ' ]['children ' ]['paypal-method-extra-content ' ][ ' children ' ]
64
- ['paylater-place-order ' ]);
63
+ ['children ' ]['payment ' ]['children ' ]['payments-list ' ]['children ' ]['paypal-method-extra-content ' ]
64
+ ['children ' ][ ' paylater-place-order ' ]);
65
65
66
66
return $ jsLayout ;
67
67
}
You can’t perform that action at this time.
0 commit comments