wamoco / magento2-payment-method-filter
该包的最新版本(1.0.0)没有提供许可证信息。
用于过滤支付方式的Magento 2模块
1.0.0
2021-01-09 11:33 UTC
Requires
- wamoco/magento2-common: >=1.0.0
This package is auto-updated.
Last update: 2024-09-09 20:06:40 UTC
README
实现自定义过滤逻辑的支付方式模块。
在你的模块 di.xml
中声明过滤器
<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>
并像这样实现它
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;
}
}