PHPackages                             liquidlab-agency/hyva-mageprince-paymentfee - 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. liquidlab-agency/hyva-mageprince-paymentfee

ActiveMagento2-module[Payment Processing](/categories/payments)

liquidlab-agency/hyva-mageprince-paymentfee
===========================================

Hyvä Checkout compatibility module for MagePrince Payment Fee - displays payment fee tax as a separate line item

1.0.0(4mo ago)0112proprietaryPHPPHP &gt;=8.1

Since Feb 19Pushed 4mo agoCompare

[ Source](https://github.com/liquidlab-agency/hyva-mageprince-paymentfee)[ Packagist](https://packagist.org/packages/liquidlab-agency/hyva-mageprince-paymentfee)[ RSS](/packages/liquidlab-agency-hyva-mageprince-paymentfee/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Liquidlab\_HyvaMagePrincePaymentFee
===================================

[](#liquidlab_hyvamageprincepaymentfee)

Hyvä Checkout compatibility module for **MagePrince Payment Fee** (`mageprince/magento2-paymentfee`).

Problems Solved
---------------

[](#problems-solved)

1. **Invisible Tax in Hyvä Checkout**: The MagePrince Payment Fee module calculates and stores the payment fee tax in the quote, but doesn't expose it as a separate line item in the checkout summary, making it "invisible" to customers.
2. **Missing REST API Support**: The MagePrince Payment Fee module doesn't expose payment fee attributes via REST API (missing `extension_attributes.xml`), preventing headless/API-based checkout implementations from accessing these values.

Solution
--------

[](#solution)

This module provides:

- ✅ **Payment Fee Tax visibility** as a dedicated line item in the Hyvä Checkout price summary
- ✅ **REST API support** by adding extension attributes and plugins for Cart (Quote) and Order entities

[![](media/hyva-checkout.png)](media/hyva-checkout.png)

Features
--------

[](#features)

- ✅ Displays Payment Fee Tax as a separate line item under the subtotal in Hyvä Checkout
- ✅ Exposes payment fee attributes via REST API for headless/API-based implementations
- ✅ Only shows when payment fee tax is enabled and has a value &gt; 0
- ✅ Fully integrated with MagePrince Payment Fee module
- ✅ Multi-language support (English &amp; Romanian included)
- ✅ No modifications to vendor code - clean, upgrade-safe implementation

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Magento 2.4.x
- **mageprince/magento2-paymentfee** - The base payment fee module
- **hyva-themes/magento2-hyva-checkout** - Hyvä Checkout

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

[](#installation)

### Composer Installation

[](#composer-installation)

```
composer require liquidlab-agency/hyva-mageprince-paymentfee
php bin/magento module:enable Liquidlab_HyvaMagePrincePaymentFee
php bin/magento setup:upgrade
php bin/magento cache:clean
```

How It Works
------------

[](#how-it-works)

1. **MagePrince Payment Fee** calculates the payment fee and tax during quote totals collection
2. It stores the tax amount in `$total->setPaymentFeeTax($tax)` but doesn't return it as a segment
3. **This module** creates a custom total collector that:
    - Doesn't recalculate anything (MagePrince already did that)
    - Simply exposes the `payment_fee_tax` segment via the `fetch()` method
    - Returns the tax amount stored by MagePrince
4. **Hyvä Checkout** picks up this segment and renders it using our custom template
5. The template displays "Payment Fee Tax" as a line item with the formatted tax amount

Technical Details
-----------------

[](#technical-details)

### Module Structure

[](#module-structure)

```
app/code/Liquidlab/HyvaMagePrincePaymentFee/
├── composer.json
├── README.md
├── registration.php
├── etc/
│   ├── module.xml
│   ├── sales.xml
│   ├── di.xml
│   └── extension_attributes.xml
├── i18n/
│   ├── en_US.csv
│   └── ro_RO.csv
├── Model/
│   └── Total/
│       └── PaymentFeeTax.php
├── Plugin/
│   └── Sales/
│       ├── AddPaymentFeeToOrder.php
│       └── AddPaymentFeeToCart.php
└── view/
    └── frontend/
        ├── layout/
        │   └── hyva_checkout_components.xml
        └── templates/
            └── checkout/
                └── price-summary/
                    └── total-segments/
                        └── payment_fee_tax.phtml

```

### Key Components

[](#key-components)

**Hyvä Checkout Integration:**

- **Model/Total/PaymentFeeTax.php** - Total collector that exposes the tax segment for display
- **view/frontend/layout/hyva\_checkout\_components.xml** - Injects the template into Hyvä Checkout
- **view/frontend/templates/.../payment\_fee\_tax.phtml** - Displays the tax line item

**REST API Integration:**

- **etc/extension\_attributes.xml** - Declares extension attributes for Cart and Order APIs
- **Plugin/Sales/AddPaymentFeeToOrder.php** - Populates payment fee data in Order REST API responses
- **Plugin/Sales/Cart/AddPaymentFeeToCart.php** - Populates payment fee data in Cart REST API responses
- **etc/di.xml** - Registers the plugins

**Configuration:**

- **etc/sales.xml** - Registers the total collector (sort\_order: 501, after MagePrince's 500)
- **etc/module.xml** - Module dependencies

### Dependencies

[](#dependencies)

The module loads in this order:

1. `Magento_Sales` - Core sales functionality
2. `Magento_Quote` - Quote management
3. `Mageprince_Paymentfee` - Calculates the payment fee tax
4. `Hyva_Checkout` - UI framework
5. `Liquidlab_HyvaMagePrincePaymentFee` - Displays the tax (this module)

Compatibility
-------------

[](#compatibility)

- **Magento**: 2.4.x
- **PHP**: 8.1+
- **Hyvä Themes**: Compatible with Hyvä Checkout
- **MagePrince Payment Fee**: All versions that support tax calculation

Support
-------

[](#support)

For issues, questions, or contributions:

- **Developer**: LiquidLab Agency
- **Website**:
- **Email**:

License
-------

[](#license)

Proprietary - Copyright © LiquidLab Agency. All rights reserved.

Credits
-------

[](#credits)

- Developed by **LiquidLab Agency**
- Compatible with **MagePrince Payment Fee** module
- Built for **Hyvä Checkout**

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance75

Regular maintenance activity

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/92c314c20b6d15684cff367c3d48732f1ea0074efedec77e2d5f9efc9b4384c5?d=identicon)[liquidlab](/maintainers/liquidlab)

---

Top Contributors

[![Hawksama](https://avatars.githubusercontent.com/u/46504593?v=4)](https://github.com/Hawksama "Hawksama (5 commits)")

### Embed Badge

![Health badge](/badges/liquidlab-agency-hyva-mageprince-paymentfee/health.svg)

```
[![Health](https://phpackages.com/badges/liquidlab-agency-hyva-mageprince-paymentfee/health.svg)](https://phpackages.com/packages/liquidlab-agency-hyva-mageprince-paymentfee)
```

###  Alternatives

[adyen/module-payment

Official Magento2 Plugin to connect to Payment Service Provider Adyen.

1673.2M10](/packages/adyen-module-payment)[mollie/magento2-hyva-checkout

Hyvä Themes Checkout module for Mollie Payments

11240.0k](/packages/mollie-magento2-hyva-checkout)[checkoutcom/magento2

Checkout.com Payment Gateway for Magento 2

34276.3k1](/packages/checkoutcom-magento2)[buckaroo/magento2

Buckaroo Magento 2 extension

32420.3k8](/packages/buckaroo-magento2)[vipps/module-payment

Vipps MobilePay Payment Module for Magento 2

1098.4k](/packages/vipps-module-payment)

PHPackages © 2026

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