fond-of-oryx/payment-total-amount-restriction

2.0.0 2023-01-20 14:07 UTC

This package is auto-updated.

Last update: 2024-03-27 11:44:39 UTC


README

license

What it does

restriction maximum allowed total amount for payment methods

Installation

composer require fond-of-oryx/payment-total-amount-restriction

Usage

register the plugin 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 TotalAmountRestrictionPaymentMethodFilterPlugin(),
    ];
}

add the following configuration to your config-file

$config[PaymentTotalAmountRestrictionConstants::TOTAL_AMOUNT_RESTRICTED_PAYMENT_METHOD_COMBINATIONS] = [
    'payment-method-name => 500000 // max amount 500.00
];