Skip to content
ShrotiHost
WHMCS Payment Infrastructure

Control every payment path

Charge or discount by payment method, and decide which methods a customer is offered in the first place — from the WHMCS admin area, without touching a checkout template.

Every invoice runs the same evaluation: fourteen context signals narrow to one rule, the allocator decides which line items form the fee base, and the result lands as a single labelled line on the invoice.

From ₹199/mo · licensed per WHMCS installation

  1. Context

    14 signals narrow the field

  2. Rules

    exactly one can win

  3. Allocator

    which items form the base

  4. Charge

    one labelled invoice line

Context

Fourteen signals reach the rule engine

Before a single rule is tested, the module assembles the invoice’s full context from WHMCS — the client and their group, the country and currency on the account, the gateway, the amounts, the cycle, and what kind of invoice this actually is. 12 of the 14 can be matched on directly; the other two are carried for the calculation and the audit trail.

Customer

4

Who is paying, and where they are.

  • Specific Client ID

    Targets one account by its WHMCS client ID.

  • Client Group

    Any client group defined in WHMCS.

  • Country

    Include one country, or every country except one.

  • Client Currency

    The currency on the client's account.

Payment

3

How they are paying, and whether tax applies.

  • Gateway

    Read live from your WHMCS payment gateways — none are hardcoded.

  • Tax Enabled

    Whether tax applies to this invoice at all.

  • Invoice Currencycarried only

    Carried through the calculation, but not matchable on its own.

Commerce

7

What is on the invoice, and what kind of invoice it is.

  • Subtotal

    Minimum and maximum bounds, on the chargeable portion.

  • Total

    Minimum and maximum bounds, tax included.

  • Billing Cycle

    Monthly through triennially, plus one-time.

  • Invoice Type

    Standard, renewal, add funds, manual, or cart preview.

  • Renewal Only

    Separates renewals from first orders.

  • Promo Code Contains

    Substring match against the applied promo code.

  • Invoice IDcarried only

    Identifies the invoice for logging and snapshots.

Live demo

Change one thing. Watch the whole decision move.

Every number below is produced by the module’s own calculation, ported line-for-line and unit-tested against the PHP. Switch the gateway, the group, the country — or take an item out of the fee base — and the trace re-derives exactly as it would on a real invoice.

  1. Context

    Reseller · IN · monthly

    Razorpay, billing type standard

  2. Rules

    Reseller rate

    priority 90 · 2 others stopped

  3. Allocator

    3 of 4 items · ₹3,098.00

    the fee base, after exclusions

  4. Charge

    ₹46.47

    Gateway Fee

Invoice context

Example configuration. The module reads whatever gateways your WHMCS has and hardcodes none. Fixed amounts are never converted between currencies — switch the currency above and watch PayPal’s fixed component stay the same number.

Invoice #1042

INR

Toggle a line to take it out of the fee base — the Items screen does this per product, addon, TLD or invoice type.

Subtotal
₹3,248.00
Tax
₹557.64
Gateway Fee
+₹46.47
Total
₹3,852.11

Rule evaluation · highest priority first

  • Reseller rateapplied · ₹46.47
  • Domestic cardsmatched, but a higher rule already won
  • Standard ratematched, but a higher rule already won
The Allocator

The fee base is not the invoice total

Charging a flat percentage of an invoice total is the naive version, and it bills your customers for things you never paid a gateway to process. The allocator breaks the invoice into its line items, resolves each one to a type it can target, and charges only on what survives.

Invoice #1042

3,248.00
  • VPS Hosting2,000.00
  • Domain renewal799.00
  • Daily Backups299.00
  • Late fee150.00
Fee base3,098.00

Tax is prorated by the surviving share (95.4%), not recalculated.

Every line resolves to something you can switch off

The Items screen lists all four categories and toggles each one in or out of the fee base — no rule editing involved.

  • Products

    Every service product WHMCS has.

  • Addons

    Configurable addon billing targets.

  • Domain TLDs

    Matched by extension.

  • Other

    Add funds, late fees, custom invoices and upgrades.

And one account can sit outside all of it

A client marked as excluded is skipped before any rule is evaluated, and the reason is written to the log. It is a switch, not a custom rate — the module has no per-client percentages, and this page will not pretend otherwise.

Rules

A rule is a condition set and an amount

Conditions combine with AND — every one has to match, and evaluation stops at the first that does not. Rules carry a priority, and the engine is exclusive: the highest-priority match wins and nothing after it is considered.

When

  • Gatewayequalsrazorpay
  • and

    Client GroupequalsReseller
  • and

    Countryis notAE
  • and

    Minimum Subtotalat least2,500.00

Then

Mode

Charge

Calculation

1.50% + fixed 3.00

Maximum Charge Cap

250.00

Priority

90

Tier steps can override the amount above a threshold, so the rate drops as invoices get larger without a second rule.

12 fields, 10 operators

Five operators are available in the admin screens. The other five exist in the engine and are reachable for anyone scripting rules directly.

equalsis notcontainsat leastat mostis one ofis none ofabovebelowbetween

Three billing models per gateway

A gateway that takes its cut before you see the money needs the charge grossed up, or you absorb the difference on every transaction.

  • Standard

    The charge is added on top. Right for almost every gateway.

  • Alternative

    Grosses up so the amount survives the gateway's own percentage cut.

  • PayPalV2

    Grosses up the base and the fixed component together.

Architecture

Where it sits inside WHMCS

Eleven hooks, three surfaces, one line item. Select any part of the path to see what is actually behind it.

WHMCS

Gateway Fees & Allocator

ContextBuilder

Assembles the fourteen signals from WHMCS — client, group, country, currencies, cycle, amounts, invoice type, renewal state, promo code and tax state — for both the invoice and the live cart.

  • ContextBuilder
  • ChargeabilityService

11 hooks, 6 admin tabs

Each hook is wrapped individually, so a failure in one is reported and contained rather than taking a page down with it. The schema migrates itself on activation.

  • Gateways

    Every gateway WHMCS has detected, with its rule count, billing type and allocation summary.

  • Allocation

    The five allocation rule types, per gateway, across six tabs.

  • Items

    Products, addons, TLDs and invoice types, each switchable in or out of the fee base.

  • Clients

    Per-account exceptions for the operational edge cases.

  • Logs

    Twenty-two named events as a filterable stream, with the full context payload.

  • Settings

    Labels and merge fields, tax defaults, retention, checkout colours, theme integration.

At checkout

What the customer sees

Two surfaces, both using labels you write. Nothing appears anywhere else in the client area — no extra page, no menu item, no email.

Order summary · checkout

Subtotal
₹3,098.00
Tax
₹557.64
Gateway Fee @ 2.00%
+₹61.96
Total
₹3,717.60

Recalculated live as the customer switches payment method. Gateways your allocation rules exclude are hidden here in the browser; the invoice is where that is enforced.

Invoice line item

Razorpay Gateway Fee @ 2.00%₹61.96

An ordinary WHMCS line item — it prints on the PDF, exports with your billing data, and is marked internally so the module can always find its own row again. Whether it carries tax follows your setting and whether anything else on the invoice is taxed.

Label merge fields

  • {gateway_name}
  • {type}
  • {percentage}
  • {percentage_suffix}
  • {amount}
  • {amount_with_currency}
  • {currency_symbol}
  • {gateway_key}
Built to be audited

You can always answer “why was I charged this?”

Every calculation is kept

Each applied charge stores a snapshot: the rule as it was, the full context as it was, and the amount. Superseded calculations are marked rather than deleted, so an invoice's history survives a rule change.

Twenty-two named log events

Suppressed charges, capped discounts, blocked gateways, recalculation fallbacks and credit that needs a human look — each is its own event with the raw payload attached. Errors also mirror into the WHMCS module log. Retention is configurable.

Contained failures

All eleven hooks are individually wrapped, so an exception is reported and contained instead of taking down a page. Admin writes are CSRF-checked, the customer-facing gateway change validates WHMCS's own token, and the preview endpoint is token-gated and rate-limited.

Licensed per installation

Validation is bound to the installation and cached locally with an encrypted blob. If the licence is inactive the module registers no hooks at all — it goes dormant rather than degrading, and your invoices are untouched.

Pricing

Licensed per WHMCS installation

Prices exclude applicable taxes, calculated at checkout.

Monthly

₹199/mo
Get the module

Quarterly

₹499/quarter
Get the module

Annual

₹1,999/year
Get the module
Questions

Before you install it

Two things. It adds a charge or a discount to an invoice based on which payment method the customer picked and the context around that invoice — and it controls which payment methods are offered in the first place. Both are configured from the WHMCS admin area; no template or checkout code is written by you.

Stop absorbing gateway costs you never chose

Set the rules once in your WHMCS admin area, and every invoice after that carries the right charge, on the right base, with a line item your customer can read.

  • Works with the gateways you already have
  • One line item per invoice, labelled by you
  • Every calculation stored and auditable