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 1212use Magento \Paypal \Model \PayLaterConfig ;
1313use Magento \Paypal \Model \SdkUrl ;
1414use Magento \Paypal \Model \Config as PaypalConfig ;
15+ use Magento \Framework \App \ObjectManager ;
1516
1617/**
1718 * PayPal PayLater component block
@@ -56,14 +57,15 @@ public function __construct(
5657 PayLaterConfig $ payLaterConfig ,
5758 SdkUrl $ sdkUrl ,
5859 array $ data = [],
59- PaypalConfig $ paypalConfig
60+ PaypalConfig $ paypalConfig = null
6061 ) {
6162 parent ::__construct ($ context , $ data );
6263 $ this ->payLaterConfig = $ payLaterConfig ;
6364 $ this ->sdkUrl = $ sdkUrl ;
6465 $ this ->placement = $ data ['placement ' ] ?? '' ;
6566 $ this ->position = $ data ['position ' ] ?? '' ;
66- $ this ->paypalConfig = $ paypalConfig ;
67+ $ this ->paypalConfig = $ paypalConfig ?: ObjectManager::getInstance ()
68+ ->get (PaypalConfig::class);
6769 }
6870
6971 /**
Original file line number Diff line number Diff line change @@ -54,14 +54,14 @@ public function __construct(
5454 }
5555
5656 /**
57- * { @inheritdoc}
57+ * @inheritdoc
5858 */
5959 public function process ($ jsLayout )
6060 {
6161 if (!$ this ->payLaterConfig ->isEnabled (PayLaterConfig::CHECKOUT_PAYMENT_PLACEMENT )) {
6262 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 ' ]);
6565
6666 return $ jsLayout ;
6767 }
You can’t perform that action at this time.
0 commit comments