51 $shortcutButtons =
$observer->getEvent()->getContainer();
53 \Magento\Paypal\Block\Express\InContext\Minicart\Button::class =>
54 PaypalConfig::METHOD_WPS_EXPRESS,
55 \Magento\Paypal\Block\Express\Shortcut::class => PaypalConfig::METHOD_WPP_EXPRESS,
56 \Magento\Paypal\Block\Bml\Shortcut::class => PaypalConfig::METHOD_WPP_EXPRESS,
57 \Magento\Paypal\Block\WpsExpress\Shortcut::class => PaypalConfig::METHOD_WPS_EXPRESS,
58 \Magento\Paypal\Block\WpsBml\Shortcut::class => PaypalConfig::METHOD_WPS_EXPRESS,
59 \Magento\Paypal\Block\PayflowExpress\Shortcut::class => PaypalConfig::METHOD_WPP_PE_EXPRESS,
60 \Magento\Paypal\Block\Payflow\Bml\Shortcut::class => PaypalConfig::METHOD_WPP_PE_EXPRESS
62 foreach ($blocks as $blockInstanceName => $paymentMethodCode) {
63 if (!$this->paypalConfig->isMethodAvailable($paymentMethodCode)) {
68 'shortcutValidator' => $this->shortcutFactory->create(
$observer->getEvent()->getCheckoutSession()),
70 if (!in_array(
'Bml', explode(
'\\', $blockInstanceName))) {
75 $shortcut = $shortcutButtons->getLayout()->createBlock(
80 $shortcut->setIsInCatalogProduct(
81 $observer->getEvent()->getIsCatalogProduct()
85 $shortcutButtons->addShortcut($shortcut);
__construct(Factory $shortcutFactory, PaypalConfig $paypalConfig)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
execute(Observer $observer)