mageprince / magento2-paymentfee

mageprince/magento2-paymentfee

Magento 2 Add Payment Fee To Order

  • Mageprince
magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: N/A Security: Pass GPL-3.0-or-later

Magento 2 Payment Fee

The Magento 2 Payment Fee extension by MagePrince allows store owners to add extra charges for specific payment methods. These fees are shown throughout the customer journey — on the cart, checkout, order summary, invoice, credit memo, and sales emails. Admins can configure different types of fees, control visibility based on customer groups or store views, and even apply rules like disabling fees over a certain order amount. The extension also supports tax and refund settings for complete flexibility.

Latest Stable Version
Total Downloads
Monthly Downloads
License
Scrutinizer Code Quality
Code Intelligence Status

✨ Features

  • Enable or disable the extension from admin configuration
  • Add payment fees for specific payment methods (e.g., COD, PayPal)
  • Fee types supported:
    • Fixed Price
    • Percentage of Order
    • Per Item
    • Per Row
  • Display fees on:
    • Checkout Page
    • Order Summary
    • Sales Emails (Order, Invoice, Credit Memo)
    • Admin Order View
  • Set custom titles for fees
  • Refundable fee option in credit memo
  • Disable fees for orders exceeding a maximum amount
  • Customer group restrictions
  • Store view restrictions
  • Set sort order for fee display
  • Supports tax calculation on the fee
    • Assign tax class
    • Choose display type: Incl., Excl., or Both
  • Multi-store and multi-currency support
  • Option to include discount/shipping in subtotal for calculation

💡 Payment Fee Types Explained

1. Fixed Price

A flat fee is added to the order, no matter what’s in the cart.

Example: Fee = 10 → You pay 10 extra.

2. Percentage Price

The fee is a percentage of the cart subtotal.

  • If “Include shipping in subtotal” is Yes:
    • Subtotal = Products + Shipping
  • If “Include discount in subtotal” is Yes:
    • Subtotal = Subtotal - Discount

Example: Fee = 10%, Subtotal = 36 → Extra = 3.60

3. Per Row

Fee is added based on the number of products (rows) in the cart.

Example: Fee = 10, Cart = 2 products → Extra = 20

4. Per Item

Fee is based on the total quantity of all products in the cart.

Example: Fee = 10, Cart = 3 items total → Extra = 30

🧪 Demo

Frontend | Backend

🚀 Installation Instructions

Option 1: Install via Composer (recommended)

composer require mageprince/magento2-paymentfee
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Option 2: Manual Installation

  1. Copy the content of the repo to the Magento 2 app/code/Mageprince/Paymentfee
  2. Run the following Magento CLI commands:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

✅ Compatibility

  • Magento Open Source (Community Edition): 2.4.4 – 2.4.8
  • Adobe Commerce (Enterprise Edition): 2.4.4 – 2.4.8

🤝 Contribution

Want to contribute to this extension? The quickest way is to open a pull request on GitHub.

🛠 Support

If you encounter any problems or bugs, please open an issue on GitHub.

📸 Screenshots

Checkout Page

image

Configuration

image image

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
2.1.7 stable Fail Magento 2.4.7-2.4.9 Details 2026-05-18 09:42:17
2.1.6 stable Not tested Not yet tested Details 2025-04-22 10:20:12
2.1.4 stable Not tested Not yet tested Details 2021-03-25 06:59:04
2.1.3 stable Not tested Not yet tested Details 2021-02-23 07:12:49
2.1.2 stable Not tested Not yet tested Details 2021-01-19 15:56:42
2.1.1 stable Not tested Not yet tested Details 2020-12-12 06:11:13
2.0.2 stable Not tested Not yet tested Details 2020-06-28 06:28:33

No dependencies declared

This package's composer.json doesn't declare any required, suggested, replaced, or conflicting packages.

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.

Static analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 26 26 warnings (ruleset: Magento2)
PHPMD Warning 5 5 rule violations (UnusedFormalParameter:2, IfStatementAssignment:1, EmptyCatchBlock:1, UnusedLocalVariable:1)
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 13 13
2.4.8 13 13
2.4.9 11 11

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Security

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit Pass 0
Malware scan Pass 0
License
GPL-3.0-or-later
Homepage
https://github.com/mageprince/magento2-paymentfee
Authors

More from mageprince

View vendor
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.