fond-of-oryx / payment-address-restrictions
2.0.1
2023-06-16 12:43 UTC
Requires
- php: >=8.0
- spryker/payment-extension: ^1.0.0
Requires (Dev)
- fond-of-codeception/spryker: ^2.0.0
- roave/security-advisories: dev-latest
- spryker-sdk/phpstan-spryker: *
- spryker/code-sniffer: *
README
What it does
Installation
composer require fond-of-oryx/payment-address-restriction
Usage
register the plugins in your dependency provider
i.E.: 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(),
];
}
add the following configuration to your config-file
$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
];