fond-of-oryx/payment-address-restrictions

2.0.1 2023-06-16 12:43 UTC

This package is auto-updated.

Last update: 2024-09-20 10:47:50 UTC


README

license

功能说明

安装

composer require fond-of-oryx/payment-address-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 CountryRestrictionPaymentMethodFilterPlugin(),
        new IdenticalAddressRestrictionPaymentMethodFilterPlugin(),
    ];
}

将以下配置添加到您的配置文件中

$config[PaymentAddressRestrictionConstants::BLACKLISTED_PAYMENT_COUNTRY_COMBINATIONS] = [
    'payment-method-name' => ['DE', 'AT', 'CH'], // payment method only allowed for DE, AT, CH
];

$config[PaymentAddressRestrictionConstants::BLACKLISTED_PAYMENT_IDENTICAL_ADDRESS_REQUIRED] = [
    'payment-method-name' // shipping- and billing address must equal
];