PHPackages                             3brs/sylius-payment-fee-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. 3brs/sylius-payment-fee-plugin

ActiveSylius-plugin[Payment Processing](/categories/payments)

3brs/sylius-payment-fee-plugin
==============================

Payment extra fee plugin for Sylius

v2.1.0(3mo ago)28.6k↓42.2%6[1 PRs](https://github.com/3BRS/sylius-payment-fee-plugin/pulls)MITPHPPHP ^8.2

Since Nov 9Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/3BRS/sylius-payment-fee-plugin)[ Packagist](https://packagist.org/packages/3brs/sylius-payment-fee-plugin)[ RSS](/packages/3brs-sylius-payment-fee-plugin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (47)Versions (14)Used By (0)

 [ ![](https://camo.githubusercontent.com/bb0c16caf210bea68e0e59fc11e0844dc47097f9aeb8b388c3de5f1414d4d1c0/68747470733a2f2f33627273312e667261312e63646e2e6469676974616c6f6365616e7370616365732e636f6d2f336272732f6c6f676f2f334252532d6c6f676f2d73796c6975732d3230302e706e67) ](https://www.3brs.com)

 Payment Fee Plugin
 [ ![](https://camo.githubusercontent.com/6a26dfeb114e0ac2c9a579288f0533855da500572c684c221169b1d297aac889/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f336272732f73796c6975732d7061796d656e742d6665652d706c7567696e2e737667) ](https://packagist.org/packages/3brs/sylius-payment-fee-plugin "License") [ ![](https://camo.githubusercontent.com/9d8593d8aec5b0235bdab170ca608599a56e05f64e74c7ed0d0d541a5b8e23eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f336272732f73796c6975732d7061796d656e742d6665652d706c7567696e2e737667) ](https://packagist.org/packages/3brs/sylius-payment-fee-plugin "Version") [ ![](https://camo.githubusercontent.com/663307f70ed37d2b36ccdcce3789b118b6d5f6d5856bb9a39af6b2816f2e67c7/68747470733a2f2f636972636c6563692e636f6d2f67682f334252532f73796c6975732d7061796d656e742d6665652d706c7567696e2e7376673f7374796c653d736869656c64) ](https://circleci.com/gh/3BRS/sylius-payment-fee-plugin "Build status")
==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#----payment-fee-plugin----------------------------------------------------)

Features
--------

[](#features)

- Charge extra fee for a payment method
- Typical usage: *Cash on Delivery*
- Taxes are implemented the same way as taxes for shipping fees

### Admin

[](#admin)

 [![Admin payment fee configuration](./doc/admin_payment_fee_configuration.png)](./doc/admin_payment_fee_configuration.png)

### Checkout

[](#checkout)

 [![Checkout payment fees](doc/checkout_payment_fees.png)](doc/checkout_payment_fees.png) [![Checkout order summary with payment fee](doc/checkout_order_summary_with_payment_fee.png)](doc/checkout_order_summary_with_payment_fee.png)

Installation
------------

[](#installation)

1. Run `composer require 3brs/sylius-payment-fee-plugin`
2. Add plugin class to your `config/bundles.php`

    ```
    return [
       ...
       ThreeBRS\SyliusPaymentFeePlugin\ThreeBRSSyliusPaymentFeePlugin::class => ['all' => true],
    ];
    ```
3. Add plugin configuration to your `config/packages/_sylius.yaml`

    ```
    imports:
       - { resource: "@ThreeBRSSyliusPaymentFeePlugin/Resources/config/config.yaml" }
    ```
4. Your Entity `PaymentMethod` has to implement `\ThreeBRS\SyliusPaymentFeePlugin\Model\PaymentMethodWithFeeInterface`. You can use Trait `ThreeBRS\SyliusPaymentFeePlugin\Model\PaymentMethodWithFeeTrait`.

    - see [test PaymentMethod](tests/Application/src/Entity/PaymentMethod.php) for inspiration

    For guide how to use your own entity see [Sylius docs - Customizing Models](https://docs.sylius.com/en/latest/customization/model.html)
5. **JavaScript Integration** - Register the Stimulus controller for dynamic calculator configuration forms:

    The plugin includes a Stimulus controller (`payment-calculator_controller.js`) that handles dynamic prototype forms for payment method calculator configuration. This allows the calculator configuration fields to appear/change dynamically when you select a calculator type in the admin panel.

    **Manual Steps Required:**

    a. In your application's admin entrypoint file (e.g., `assets/admin/entrypoint.js`):

    ```
    import { startStimulusApp } from '@symfony/stimulus-bridge';
    import PaymentCalculatorController from '../../vendor/3brs/sylius-payment-fee-plugin/src/Resources/assets/admin/controllers/payment-calculator_controller';

    // Start Stimulus app
    export const app = startStimulusApp();

    // Register the payment calculator controller from the plugin
    app.register('payment-calculator', PaymentCalculatorController);
    ```

    b. Rebuild your assets after adding the controller:

    ```
    yarn install
    yarn build
    ```

    **How it works:**

    - When you select a calculator type (e.g., "Flat rate") in the payment method form, the controller dynamically loads the appropriate configuration fields
    - On the edit page, it preserves existing saved values
    - On the create page, it initializes empty fields for the selected calculator
    - The controller uses Stimulus data attributes: `data-controller="payment-calculator"`, `data-payment-calculator-target="select"`, and `data-payment-calculator-target="container"`
6. Create and run doctrine database migrations:

    ```
    bin/console doctrine:migrations:diff
    bin/console doctrine:migrations:migrate
    ```

Development
-----------

[](#development)

### Usage

[](#usage)

- Alter plugin in `/src`
- See `bin/` dir for useful commands

### Testing

[](#testing)

After your changes you must ensure that the tests are still passing.

```
composer install
bin/console doctrine:database:create --if-not-exists --env=test
bin/console doctrine:schema:update --complete --force --env=test
yarn --cwd tests/Application install
yarn --cwd tests/Application build

bin/behat
bin/phpstan.sh
bin/ecs.sh
vendor/bin/phpspec run
```

### Opening Sylius with your plugin

[](#opening-sylius-with-your-plugin)

1. Install symfony CLI command:

    - hint: for Docker (with Ubuntu) use *Debian/Ubuntu — APT based Linux* installation steps as `root` user and without `sudo` command
        - you may need to install `curl` first `apt-get update && apt-get install curl --yes`
2. Run app

    ```
    (cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load)
    (cd tests/Application && APP_ENV=test symfony server:start --dir=public --port=8080)
    ```

- change `APP_ENV` to `dev` if you need it

License
-------

[](#license)

This library is under the MIT license.

Credits
-------

[](#credits)

Developed by [3BRS](https://3brs.com)
Forked from [manGoweb](https://github.com/mangoweb-sylius/SyliusPaymentFeePlugin).

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance81

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~219 days

Recently: every ~59 days

Total

8

Last Release

111d ago

Major Versions

v1.3.0 → v2.0.02025-10-24

PHP version history (4 changes)v1.0.0PHP ^7.3|^8.0

v1.1.0PHP ^8.0

v1.2.0PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2500352?v=4)[Johan Hornof](/maintainers/hornofj)[@hornofj](https://github.com/hornofj)

![](https://avatars.githubusercontent.com/u/13216499?v=4)[Vašo](/maintainers/VasoOppelt)[@VasoOppelt](https://github.com/VasoOppelt)

![](https://www.gravatar.com/avatar/ab23998c28b111996e4b3357f20929d6904a97ac21724750e1dfafd6a09791e4?d=identicon)[ondrej-kuhnel](/maintainers/ondrej-kuhnel)

---

Top Contributors

[![jaroslavtyc](https://avatars.githubusercontent.com/u/2290225?v=4)](https://github.com/jaroslavtyc "jaroslavtyc (18 commits)")[![AdhamKandeel27](https://avatars.githubusercontent.com/u/108978262?v=4)](https://github.com/AdhamKandeel27 "AdhamKandeel27 (5 commits)")[![ondrej-kuhnel](https://avatars.githubusercontent.com/u/6840281?v=4)](https://github.com/ondrej-kuhnel "ondrej-kuhnel (5 commits)")[![HonzaMatosik](https://avatars.githubusercontent.com/u/13003350?v=4)](https://github.com/HonzaMatosik "HonzaMatosik (1 commits)")[![VasoOppelt](https://avatars.githubusercontent.com/u/13216499?v=4)](https://github.com/VasoOppelt "VasoOppelt (1 commits)")

---

Tags

pluginextrasyliuspaymentsylius-pluginfee

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/3brs-sylius-payment-fee-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/3brs-sylius-payment-fee-plugin/health.svg)](https://phpackages.com/packages/3brs-sylius-payment-fee-plugin)
```

###  Alternatives

[bitbag/sylius-adyen-plugin

BitBag Adyen plug-in for Sylius.

1249.9k](/packages/bitbag-sylius-adyen-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
