18 private $paymentMethodList;
23 private $storeManager;
30 \
Magento\Payment\Api\PaymentMethodListInterface $paymentMethodList,
31 \
Magento\Store\Model\StoreManagerInterface $storeManager
33 $this->paymentMethodList = $paymentMethodList;
47 $configuration = &$jsLayout[
'components'][
'checkout'][
'children'][
'steps'][
'children'][
'billing-step']
48 [
'children'][
'payment'][
'children'][
'renders'][
'children'];
54 $storeId = $this->storeManager->getStore()->getId();
55 $activePaymentMethodList = $this->paymentMethodList->getActiveList(
$storeId);
56 $getCodeFunc =
function (
$method) {
59 $activePaymentMethodCodes = array_map($getCodeFunc, $activePaymentMethodList);
62 $notActivePaymentMethodCodes = array_diff(array_keys($groupConfig[
'methods']), $activePaymentMethodCodes);
63 foreach ($notActivePaymentMethodCodes as $notActivePaymentMethodCode) {
64 unset(
$configuration[$paymentGroup][
'methods'][$notActivePaymentMethodCode]);
beforeProcess(\Magento\Checkout\Block\Checkout\LayoutProcessor $processor, $jsLayout)
__construct(\Magento\Payment\Api\PaymentMethodListInterface $paymentMethodList, \Magento\Store\Model\StoreManagerInterface $storeManager)