Hyperswitch surcharge rules

Hyperswitch surcharge rules let a self-hosted merchant pass card processing fees to customers based on payment parameters such as amount and currency. Confirm card network and local rules before switching them on.

On this page

How Hyperswitch surcharge rules work and when to use them

If you run a self-hosted Hyperswitch stack and want card processing costs passed to customers, the Hyperswitch surcharge feature is the control that does it. Surcharge rules are conditions you configure on payment parameters such as amount and currency, and each matching payment can carry a surcharge. The feature sits alongside routing and processor configuration rather than replacing them, so a payment is first routed to a processor and the surcharge logic then determines what the customer is charged. Teams usually need this when processing costs vary by card type, currency or ticket size and a flat margin would either overcharge small payments or undercharge large ones.

The Hyperswitch surcharge documentation describes the feature only at this level: rules built on payment parameters, applied to payments. It does not, in the material available for this page, set out the full list of supported parameters, how surcharge amounts are calculated, how the surcharge appears in checkout and receipts, or how it interacts with retries and partial captures. Confirm each of these in the Hyperswitch surcharge documentation before you design rules, and ask your Hyperswitch contact or the open-source maintainers to confirm anything the docs leave open for your version.

Before you switch surcharges on, treat the rule set as a compliance and customer-experience decision, not only a pricing one. Card network and local rules on surcharging differ by scheme, country and sometimes by state, and some markets restrict or prohibit surcharges entirely. Have your payments or legal team confirm which networks and regions you will surcharge in, document the disclosure you will show customers, and test each rule against the amount and currency combinations you expect in production. Plan a staged rollout in a sandbox or non-production environment first, so you can confirm the surcharge amounts your self-hosted stack returns match what your finance team expects.

Surcharge rule options and when each fits

This table compares the payment parameters a Hyperswitch surcharge rule can key on and what each one changes at checkout and in reconciliation. Use it to decide which conditions fit your pricing, then confirm each parameter against the current surcharge documentation before enabling it. The main takeaway is that every rule condition changes what the customer sees, so each one needs a matching record in finance.

ParameterWhen it fitsWhat it changes at checkout and in reconciliation
Payment amountSurcharge only on smaller or larger tickets, or where a flat fee would be a high share of the saleCustomers see a different total depending on the amount; each charged surcharge should be stored on the payment so finance can match it to the processor settlement
CurrencyDifferent surcharge treatment for domestic and cross-currency payments, or where local rules differ by currencyThe displayed fee and the settled amount can differ by currency; reconciliation must handle surcharge amounts in each currency separately
Payment method or card typeOnly where your pricing and the applicable card network rules treat that method differently; confirm the exact parameter names in the docsCustomers see the fee only after choosing that method, so the checkout must show it before final confirmation; records need the method label for fee reporting
Card network or card brandOnly where the network rules you are subject to permit a surcharge on that brand; confirm the parameter and its supported values in the docsCustomers may see different totals by card brand; reconciliation needs the brand on each surcharged payment to match network rules
Country or billing locationWhere local rules or regulations limit or require disclosure of surcharges in a specific market; confirm supported fields in the docsCheckout totals vary by location, and the location used for the rule must match the one stored on the payment record
Combined conditionsWhen one rule must apply only to a specific mix, such as a method in a currency above an amountMore conditions make the rule harder to audit; test each combination in the sandbox and keep a written map from rule to expected fee
Rule ordering and default behaviorWhen several rules could match one payment and you need a predictable resultIf ordering is unclear, the customer may see an unexpected fee; document the evaluation order and confirm the fallback when no rule matches

How to set up surcharge rules in a self-hosted stack

This sequence takes surcharge rules from a confirmed, compatible deployment to a tested configuration where the amount a customer sees matches the amount stored on the payment record.

  1. Confirm version and Control Center compatibility

    Before touching surcharge settings, the platform owner records the Hyperswitch version running on the router and the Control Center version in use. Check both against the compatibility matrix on the Hyperswitch releases page for the release you run, and confirm that the Control Center exposes the surcharge configuration. If the stack is behind the release you need, plan the upgrade first, since surcharge configuration should not be changed during a version mismatch. Done when you have written down both versions and confirmed they are listed as compatible together.

  2. Confirm connected processors and payment methods

    Someone on the payments team lists every processor connector and payment method that will take surcharged payments, then confirms each connector is live in the Control Center and has working credentials. Surcharge behavior depends on the payment method and processor in each transaction, so this list defines what the rules must cover. Ask each processor and card network what their rules allow for surcharging before you go further. Done when you have a signed-off list of connectors and payment methods in scope.

  3. Define surcharge rule conditions on amount and currency

    Configure the surcharge rules in the Control Center using payment parameters such as amount and currency. Write each rule as a condition and a resulting surcharge, and keep a short table that maps each condition to its intended outcome, including transactions that match no rule. Ask the finance and compliance owners to review the table before it goes live. Done when every rule has a written purpose and the default behavior for unmatched payments is documented.

  4. Check card network and local rules

    Before enabling any rule, the compliance owner checks the card network rules and local regulations that apply to each market where surcharges will be applied, including any caps, disclosure requirements or prohibitions. Record the source of each check and the date it was made. Because these rules change and vary by jurisdiction, obtain confirmation from your acquirer or legal counsel rather than relying on this guide. Done when each enabled market has a written confirmation and the rule table reflects it.

  5. Test rules in a sandbox or local Docker setup

    Run the configured rules in a non-production environment, either the local Docker setup or a hosted sandbox. Create test payments that match each rule condition and at least one that matches none, using amounts and currencies on both sides of each threshold. Confirm the surcharge applied matches the rule table for every case. Done when every test case in the table produces the expected surcharge and failing cases are logged and fixed before promotion.

  6. Verify the amount shown at checkout

    Using the checkout integration in the test environment, have a tester walk through the payment flow for each rule case and record the total the customer sees before confirming. Compare each displayed total with the expected base amount plus surcharge, and confirm the surcharge line is labeled as your disclosure requires. Done when every checkout total matches the rule table and the disclosure copy has been approved by the compliance owner.

  7. Verify the stored payment record and reconcile

    Open the stored payment record for each test transaction in the Control Center and confirm the base amount, surcharge amount and total charged are stored separately and agree with the checkout total and the processor's response. Pull one day of test transactions into your reporting to confirm the totals reconcile. Done when every stored record matches its checkout total, and the reconciliation check passes before any rule is enabled for live traffic.

What to check against card network and local rules before enabling surcharges

Card networks and local jurisdictions set their own rules on whether a surcharge is allowed, how it must be disclosed, and how large it can be. These rules differ by country, by card type and by processor, so a surcharge rule that works in one market can be non-compliant in another. Before you enable any surcharge rule in your Hyperswitch configuration, confirm which markets, card brands and payment methods the rule will touch, and check the applicable rules for each one. Treat the Hyperswitch rule as the technical switch only. The permission to surcharge comes from outside your platform.

Get written confirmation from your acquirer or processor that the surcharge is permitted for the exact combination of merchant category, country, card type and connector you plan to use. Processor terms often add requirements beyond the card network rules, such as disclosure wording, the point in checkout where the fee must appear, or restrictions on surcharging debit cards. Ask legal counsel in each relevant jurisdiction to review the customer-facing wording and the disclosure flow. Do not rely on general guidance from a vendor or a blog post for these answers, and do not state network limits or percentages in internal documents unless they come from the written source you received.

Document the decision before go-live. Record which surcharge rules are enabled, which markets and connectors they apply to, the written confirmations you received and their dates, the counsel review, and the person who approved the change. Schedule a recheck whenever a processor changes its terms, you add a market or connector, or card network rules change, and make a rule change require the same sign-off as the original. This record is also the evidence your compliance and audit teams will ask for when they review how fees are presented to customers.

Security and operational considerations for surcharge rules

Surcharge rules change what customers pay and what finance records, so they need the same control as pricing. The cards below cover who can change rules, how changes are traced, how customers are told, and how surcharged amounts flow through refunds, reconciliation and upgrades of the self-hosted stack.

Rule change control

Decide who can create, edit and publish surcharge rules in the Control Center before go-live, and keep that list short. A rule change alters the amount a customer is charged, so it should follow the same approval path as a pricing change. Confirm which Control Center roles can edit surcharge configuration and whether a second person must review a rule before it applies to live traffic. Test each rule in the sandbox against amount and currency boundaries first.

Surcharge docs

Audit trail of rule changes

Record who changed a surcharge rule, when, and what the rule looked like before and after. Without this record, a sudden change in surcharge revenue or customer complaints cannot be traced to a specific edit. Ask the Hyperswitch team which configuration changes are logged by the platform and which must be captured in your own change tickets or infrastructure-as-code history. Export the log to your central logging system so it survives changes to the dashboard.

Customer disclosure at checkout

A surcharge must be shown to the customer before they authorize the payment. Check how your checkout displays the surcharge amount, the total and the label, and confirm that the surcharged total is the amount sent for authorization. Card network and local rules can require disclosure wording or limit surcharging for certain card types, so review those rules for each market before enabling a surcharge. Keep screenshots of each checkout version for your compliance file.

Surcharge amounts in refunds and captures

Decide how the surcharge is treated when a payment is partly refunded, fully refunded, or captured for less than the authorized amount. Some merchants refund the surcharge with the goods, others keep it, and the rule must match your terms and local requirements. Test a full refund, a partial refund and a partial capture in the sandbox, and confirm which amount the processor reports back for each. Document the outcome so support staff handle customer requests consistently.

Reconciliation of surcharged amounts

A surcharge adds a line that does not exist in your order system, so reconciliation must separate the base price from the surcharge. Ask finance to define where surcharge revenue is booked, how it matches processor settlement reports, and how it is reported for tax purposes. Compare the surcharged amount in Hyperswitch, the processor record and the bank deposit for a sample of transactions. Mismatches usually come from partial captures or refunds handled outside the platform.

Rule alignment with stack upgrades

Surcharge behavior can change when the self-hosted Hyperswitch stack is upgraded, so each upgrade needs a regression check of surcharge rules. Review the release notes and compatibility matrix for each planned version, and rerun your surcharge test cases in a staging environment before production. Keep rule definitions in version control where possible so you can restore them if an upgrade changes how they evaluate.

Hyperswitch releases

How a payment passes through surcharge rule evaluation

The flow starts when checkout sends a payment request to the Router, the Hyperswitch core app server. The Router evaluates payment parameters such as amount and currency against the configured surcharge rules, then either applies a surcharge or leaves the amount unchanged. The payment then moves on to routing and the processor the routing logic selects. Check that the surcharge decision is recorded with the final amount, because that stored value is what your reconciliation and reporting will read.

Surcharge evaluation sits inside the Router before routing selects a processor.

Questions teams ask before enabling Hyperswitch surcharges

How much effort does setting up Hyperswitch surcharge rules take?

Effort depends less on the rule syntax than on how many payment methods, currencies and processors the rules must cover. Surcharge rules are built on payment parameters such as amount and currency, so each combination you want to surcharge needs a defined condition and a tested result. Teams with one currency and one card processor have a small rule set to test. Teams with several currencies, local payment methods and multiple connectors need a longer design phase, because each connector's fee structure and each market's rules must be mapped before any rule is written. Ask any partner to break effort into rule design, configuration, testing and go-live, and to state which of those depends on your processor count. Durations come from a written scope, not from this page.

Can an in-house team set up surcharges without a partner?

Yes, if the team already runs Hyperswitch in its own infrastructure and has someone who can configure the Control Center and test payment flows end to end. The configuration itself is not the hard part. The hard parts are deciding which fees to pass on, confirming that card network and local rules allow the surcharge in each market, and proving that checkout shows the correct amount before the charge. A team that has not done this before often benefits from an outside review of the rule design before go-live. DeployOpen can plan, configure and test surcharge rules as a fixed-scope engagement, or review a rule set your team has already written.

What does the surcharge work need from finance and legal?

Finance and legal decide the policy before engineering writes any rule. Finance needs to supply the processor fee schedules, the cost components the business wants to recover, and the amounts or percentages it plans to apply by method and market. Legal needs to confirm whether surcharging is permitted in each jurisdiction and under each card network's rules, and what disclosure the customer must see before paying. Customer-facing wording, refund treatment of surcharges and how surcharges appear on receipts also need sign-off. Engineering cannot settle these questions, so ask for a written decision log from both teams before the build starts.

How should a team test surcharge rules safely before going live?

Test in a non-production Hyperswitch environment using test credentials from each connector, and cover every rule path, including the boundaries of each amount and currency condition. Confirm that the customer sees the surcharge before confirming payment, that the authorized total matches the displayed total, and that refunds and captures reflect the correct base and surcharge amounts. Check the behavior when a payment falls outside every rule, because that default path is where surprises often appear. Keep a written test matrix and a rollback plan that switches surcharges off without touching other payment settings. Ask any partner to show the test matrix and the retest steps before a production change.

What ongoing work recurs after Hyperswitch upgrades?

Hyperswitch ships roughly monthly minor releases, and each release lists a compatibility matrix for the Control Center and web client versions. After each upgrade, the team should confirm that existing surcharge rules still evaluate as expected, that the Control Center still exposes the settings used, and that the checkout SDK still renders surcharge amounts correctly. Fee schedules change as processors update pricing, so rule amounts need periodic review. Card network rules can also change. Plan a recurring review that covers both software compatibility and fee and policy changes, and decide who owns each check. Ongoing testing and upgrades are available as a retainer from DeployOpen.

Which cost components should a quote for surcharge work cover?

A written quote should separate one-time work from recurring work. One-time items usually include discovery of current fees and policy, rule design, configuration in the Control Center, checkout and receipt verification, test execution and go-live support. Recurring items include upgrade testing after each Hyperswitch release, fee schedule reviews and retesting after rule changes. Ask whether the quote includes the hosting and infrastructure costs of your self-hosted stack, which are separate from the implementation fee, and whether any third-party tooling or processor charges apply. DeployOpen does not publish a price list. A quote follows from the written scope, so ask for each component to be listed with its assumptions.

Do surcharge rules need a separate security review?

They should be reviewed as part of payment flow security, because a surcharge changes the amount the customer pays and the data passed to processors. Check that rule logic runs on the server side rather than in the browser, that no customer or card data is added to the rule evaluation outside the scope you have documented, and that admin access to the Control Center is limited to the people who manage pricing. Confirm how changes to rules are logged and who approves them. Your compliance team should also confirm whether any change alters your PCI DSS scope before it goes live. DeployOpen does not issue attestations, but it can prepare the controls and evidence your assessor will request.

How DeployOpen works on this

DeployOpen plans, implements, customizes, tests and documents self-hosted open-source platforms inside your own infrastructure. For Hyperswitch surcharge rules, that means agreeing in writing which surcharge conditions, currencies and card rules are in scope before any configuration changes reach a live merchant profile.

How we scope

  • Written scope lists the surcharge rule conditions, currencies and payment methods covered for your merchant profiles.
  • Scope records which card networks and local rules your compliance team has confirmed before surcharging is enabled.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • Surcharge rules are configured in a non-production environment first, with test payments covering each rule branch.
  • Rule logic is checked against amount and currency thresholds, including edge values near each boundary.
  • Configuration is kept in version-controlled, reviewable form so changes can be traced and rolled back.

How we hand over

  • Handover includes a rule register describing each surcharge condition, its purpose and its owner.
  • Runbooks explain how to change a rule, retest it and confirm the change reached the checkout flow.
  • Evidence of testing and approvals is packaged so your security, compliance and finance teams can review it.

How we support

  • Ongoing support covers rule changes after card network or local rule updates, available as a retainer.
  • Hyperswitch upgrades are checked against existing surcharge rules before each planned release is applied.
  • Periodic retesting confirms surcharge behavior still matches the agreed rule register after changes.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.