How to charge Magento 2 Payment Fee

How to charge Magento 2 Payment Fee

July 15, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to charge Magento 2 Payment Fee

Charging Payment Fees in Magento 2

In Magento 2, adding payment fees based on the selected method requires careful integration of core functionality. Unfortunately, there isn’t a direct equivalent to the Magento 1 module you mentioned for charging fees per payment method.

However, we can achieve this by leveraging Magento’s built-in payment methods and their configuration options. Here’s a step-by-step guide to adding a fee for certain payment methods in your Magento 2 store:

Step 1: Enable Payment Methods

First, ensure that the payment methods you want to charge fees for are enabled in your Magento backend. Navigate to Stores > Settings > Configuration > Sales > Payment Methods and enable the desired methods.

Step 2: Configure Additional Fees

For each payment method, Magento allows you to configure additional fees. These can be flat rates or percentage-based amounts. To access this configuration:

  • Go to Stores > Settings > Configuration > Sales > Payment Methods.
  • Select the specific payment method (e.g., Cash On Delivery).
  • Scroll down to find the “Additional Fees” field set.

In this field, you can specify a fee amount (flat) or percentage of the order total. Remember that these fees will be added for every order using this payment method.

Step 3: Extending Payment Methods (Advanced)

If you require more complex fee calculations or conditions, you may need to extend the core payment methods in your custom module. This involves creating a new payment model and redefining its logic.

For example, you might want to charge a fee only for orders above a certain value or if the customer selects specific shipping options.

Here’s an overview of how this would work:

  1. Create a new payment method by extending \Magento\Payment\Block\Form\AbstractForm.
  2. Override the calculate method in your new payment model to perform your fee calculation logic.
  3. Update the configuration for your custom payment method with the additional fees.

Best Practices

  • Always test fee configurations thoroughly before deploying them to a live site.
  • Be transparent about any fees applied during checkout. This includes displaying the fee amount clearly and describing what it covers.
  • Consider offering discounts or promotions to offset these fees if possible.

Remember, charging extra fees should be done judiciously and with clear communication to your customers. High or unexpected fees can lead to cart abandonment.

Conclusion

In Magento 2, adding payment fees based on the selected method requires a combination of configuration and potentially custom development for more complex scenarios.

By leveraging Magento’s built-in payment methods and their fee configuration options, you can easily add standard flat or percentage-based fees. For advanced requirements, extending core payment models in your own module provides the necessary flexibility.

For further details on Magento 2 development best practices, feel free to explore our resources at Laravel Company. We routinely publish articles covering topics like extension development, performance optimization, and security in the Magento ecosystem.

Magento 2 Magento 1 Extensions Admin

Our network