WP Manifestindependent plugin directory
manifest / ecommerce / pronamic-payment-gateways-fees-for-woocommerce

Pronamic Payment Gateways Fees for WooCommerce WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

This WordPress plugin adds settings to all WooCommerce gateways to add a fixed and/or variable (percentage) fee.

★ 3stars
21release downloads
≈10active sites
232composer installs
v1.0.3latest · 1 year ago

Install

Download pronamic-payment-gateways-fees-for-woocommerce.1.0.3.zip From the v1.0.3 release on GitHub, Jun 19, 2025

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/pronamic/pronamic-payment-gateways-fees-for-woocommerce/releases/download/v1.0.3/pronamic-payment-gateways-fees-for-woocommerce.1.0.3.zip

On Packagist as pronamic/pronamic-payment-gateways-fees-for-woocommerce:

composer require pronamic/pronamic-payment-gateways-fees-for-woocommerce
Updates itself. It ships its own updater (Update URI header), so new versions appear under Dashboard → Updates.

Pronamic Payment Gateways Fees for WooCommerce

This WordPress plugin adds settings to all WooCommerce gateways to add a fixed and/or variable (percentage) fee.

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Introduction

This WordPress plugin adds settings to all WooCommerce gateways to add a fixed and/or variable (percentage) fee.

Installation

composer require pronamic/pronamic-payment-gateways-fees-for-woocommerce
\Pronamic\WooCommercePaymentGatewaysFees\Plugin::instance()->setup();

Screenshots

Screenshot of the WooCommerce direct bank transfer payment method settings page in the WordPress admin dashboard with the extra fees settings.

Flow

WooCommerce recommends using the woocommerce_cart_calculate_fees hook to add fees:

We suggest using the action woocommerce_cart_calculate_fees hook for adding fees.

Source: https://github.com/woocommerce/woocommerce/blob/8.1.0/plugins/woocommerce/includes/class-wc-cart-fees.php#L7

This hook is called as soon as the WC()->cart->calculate_totals() function is called, WooCommerce uses the WC_Cart_Totals class to calculate totals:

class-wc-cart.php

/**
 * Calculate totals for the items in the cart.
 *
 * @uses WC_Cart_Totals
 */
public function calculate_totals() {
    $this->reset_totals();

    if ( $this->is_empty() ) {
        $this->session->set_session();
        return;
    }

    do_action( 'woocommerce_before_calculate_totals', $this );

    new WC_Cart_Totals( $this );

    do_action( 'woocommerce_after_calculate_totals', $this );
}

Source: https://github.com/woocommerce/woocommerce/blob/8.1.0/plugins/woocommerce/includes/class-wc-cart.php#L1393-L1411

When creating a WC_Cart_Totals instance, the WC_Cart_Totals->calculate() function is executed:

class-wc-cart-totals.php

/**
 * Run all calculation methods on the given items in sequence.
 *
 * @since 3.2.0
 */
protected function calculate() {
    $this->calculate_item_totals();
    $this->calculate_shipping_totals();
    $this->calculate_fee_totals();
    $this->calculate_totals();
}

Source: https://github.com/woocommerce/woocommerce/blob/8.1.0/plugins/woocommerce/includes/class-wc-cart-totals.php#L127-L154

What can be seen here is that the final totals are calculated after calculating the fee totals. This means that the order total is not yet available within the woocommerce_cart_calculate_fees hook. In other words, within the woocommerce_cart_calculate_fees hook the result of $cart->get_total( '' ) will always be 0.

This is inconvenient because the payment gateway fees are often based on the total amount to be paid. That's why we hook into the woocommerce_after_calculate_totals hook and recalculate the totals again. This extra calculation seems double, but it seems to be the easiest way to reliably request the cart total.

Pronamic - Work with us

Releases

4 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.0.3 latest
Jun 19, 2025 1 year ago
pronamic-payment-gateways-fees-for-woocommerce.1.0.3.zip
8
Mar 14, 2024 2 years ago
pronamic-payment-gateways-fees-for-woocommerce.1.0.2.zip
7
Nov 6, 2023 2 years ago
pronamic-payment-gateways-fees-for-woocommerce.1.0.1.zip
1
Oct 31, 2023 2 years ago
pronamic-payment-gateways-fees-for-woocommerce.1.0.0.zip
5

Active-site estimate ≈10 comes from the median of recent superseded releases. Method.

A grade

Security

Pronamic Payment Gateways Fees for WooCommerce 1.0.3 · audited by WP Registry

No security issues found.

Audited release
1.0.3
Findings
none
Worst severity
—
Content hash
621f85720ca6e9f6ddf0959c…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.