fond-of-oryx / payment-product-restriction
此包已被弃用,不再维护。未建议替代包。
1.0.2
2022-05-03 09:42 UTC
Requires
- php: >=7.4
- spryker/payment-extension: ^1.0.0
Requires (Dev)
This package is auto-updated.
Last update: 2022-06-09 06:55:57 UTC
README
它做什么
对支付方式的支付产品进行限制
安装
composer require fond-of-oryx/payment-product-restriction
用法
在您的依赖提供者中注册插件
例如:Pyz\Zed\Payment\PaymentDependencyProvider.php
/**
* @return array<int, \Spryker\Zed\PaymentExtension\Dependency\Plugin\PaymentMethodFilterPluginInterface>|array<int, \Spryker\Zed\Payment\Dependency\Plugin\Payment\PaymentMethodFilterPluginInterface>
*/
protected function getPaymentMethodFilterPlugins(): array
{
return [
...,
new PaymentProductRestrictionPaymentMethodFilterPlugin(),
];
}
将以下配置添加到您的配置文件中
$config[PaymentProductRestrictionConstants::BLACKLISTED_PAYMENT_METHODS_PRODUCT_ATTRIBUTE] = 'blacklisted_payment_methods';
预期黑名单支付方式存储的属性是一个以逗号分隔的列表。列表应包含商店中不允许用于产品的特定支付方式。
####示例
$product = [
'abstract_attributes' => [
'_' => [
'blacklisted_payment_methods' => 'invoice',
]
]
]