wamoco/magento2-payment-method-filter

There is no license information available for the latest version (1.0.0) of this package.

Magento 2 Module to filter payment methods

Installs: 151

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:magento2-module

pkg:composer/wamoco/magento2-payment-method-filter

1.0.0 2021-01-09 11:33 UTC

This package is auto-updated.

Last update: 2025-10-09 22:38:03 UTC


README

Module to implement custom filter logic for payment methods.

In your module di.xml declare the filter:

<type name="Wamoco\PaymentMethodFilter\Model\FilterProcessor">
    <arguments>
        <argument name="filters" xsi:type="array">
            <item name="checkmo" xsi:type="object">Vendor\Module\Model\Filter</item>
        </argument>
    </arguments>
</type>

And implement it like this:

class Filter implements \Wamoco\PaymentMethodFilter\Api\FilterInterface
{
    public function isFiltered(
        \Magento\Quote\Api\Data\PaymentMethodInterface $method,
        \Magento\Quote\Api\Data\CartInterface $quote
    ) {
        if ($method->getCode() == 'checkmo') {
          return true;
        }
        return false;
    }
}