Building a custom Hyperswitch connector

A planning guide for teams adding a processor Hyperswitch does not yet support: where connector code lives, which payment flows to implement, how to test, and when to contribute upstream instead of carrying a fork.

On this page

Building a custom Hyperswitch connector: when your processor is not in the list

If your processor is not in Hyperswitch's list, the answer is a code change to the core, not a plugin. Hyperswitch documents connections to more than 100 payment processors in its README, including Stripe, Adyen, PayPal, Worldpay and Checkout.com, so the first step is to confirm that the processor you need is truly absent from the current connector list in the repository, including any regional or product-specific variants. A custom connector is written in Rust inside the core app server (the Router service that handles routing, retries and vaulting), then compiled and deployed as part of your self-hosted stack. Your team owns that code, its upgrades and its test coverage from the day it is merged. Before estimating effort, read the connector payment flows page, which outlines the payment flows a connector encounters, and map each flow your business needs against what the processor's API actually offers.

The decision that shapes everything else is which flows the connector must implement at launch. Authorization, capture, void, refund and status sync are the usual starting set, but payouts, recurring payments, network tokens and 3DS handling each add their own request, response and webhook logic. Confirm with the processor, in writing, how it handles idempotency, error codes and asynchronous status changes, because Hyperswitch's flow model will expect each of those to be translated into its own status values. Also confirm where credentials and webhook signatures are configured in your deployment, since a connector that works in a test sandbox can still fail once secrets come from your own secret store.

Plan for the cost of maintenance before the first build. Every processor API change, every Hyperswitch minor release and every new flow you add becomes work for the team that owns the connector, and a connector that stays only in your fork will need rebasing against each upstream release. Ask the repository maintainers early whether a connector of this kind fits the project's contribution process, and check the open issues and pull requests for a similar processor before you start. Treat the upstream conversation as part of the design: a connector reviewed and merged upstream is far easier to keep current than a private patch set that drifts from the main branch.

What a team needs before writing connector code

A connector is only as testable as the environment around it. The items below set the baseline the team needs before the first line of connector code, and each one removes a source of rework later in the build.

A self-hosted Hyperswitch build

Start from a tagged version of the juspay/hyperswitch repository that the team has chosen and tested in its own environment, not from an unpinned main branch. Build and run the router locally first, then confirm that an existing built-in connector completes an authorize and a refund end to end. This proves the stack works before any new connector code can be blamed for a failure. Record the exact version so later merges and upgrades can be compared against it.

Hyperswitch repository

Release line and Superposition

Check the current release line on the releases page before choosing a version, since minor releases arrive roughly monthly and each carries a compatibility matrix for Control Center and web client versions. Deployments must run a Superposition service before upgrading to v1.124.0 or later, because Superposition became a required configuration dependency in that release. Confirm this dependency in the staging environment before any upgrade is scheduled.

Hyperswitch releases

Rust toolchain matching the repository

Install the Rust toolchain and build tooling that the chosen repository tag specifies, rather than whatever version is current on the workstation. Mismatched compilers are a common source of confusing build failures in a large Rust workspace. Pin the toolchain in the team's build image so every engineer and the CI pipeline compile the connector the same way.

Processor sandbox and full API documentation

Obtain sandbox credentials from the processor and confirm that the team can make live calls to its test endpoints. Collect the complete API reference, including authorization, capture, void, refund, sync and webhook payloads, plus the error code catalogue. Without the full reference, the connector will cover only the happy path and fail on edge cases such as partial captures or declines that arrive asynchronously. Ask the processor which settlement and webhook behaviors differ between sandbox and production.

Local Docker or Kubernetes test environment

Decide whether the team will test through the Docker-based local setup or a Kubernetes cluster that mirrors the production Helm deployment. The Docker setup suits fast iteration on the connector, while a cluster exposes the routing, secret and webhook ingress behavior that a laptop hides. Plan a route that lets the processor send webhooks to the test environment, because callbacks that never arrive are hard to diagnose later.

A named owner for the connector code

Assign one engineer as the accountable owner for the connector, with a second person who can review changes to the request mapping, status mapping and webhook handling. Decide up front whether the code will be contributed upstream or kept as a private extension, because that choice determines licensing, review and merge effort. Record who will respond when the processor changes its API, since that owner will carry the connector after the first release.

Where connector code lives and which path to take

A private fork copies the whole Hyperswitch repository into your own organization and lets your team change any file, including the connector code and the shared core that the connector calls. This gives the most freedom, and it is the path where a change can be made quickly without waiting for an outside review. The cost arrives at upgrade time, because every change you made in shared code must be merged against each new upstream release.

  • Full control: Any file can change, so a connector can be written without waiting for upstream decisions.
  • Merge cost at each upgrade: Edits to shared core files can conflict with upstream changes, and each conflict needs a reviewed resolution.
  • Drift over time: The longer a fork runs without merging upstream, the more the code diverges and the harder it is to return to a supported state.
  • Security patches: Your team must watch upstream security fixes and port them into the fork on its own schedule.
  • Ownership: Someone must own the fork's build, tests and release process in addition to the connector itself.

Before choosing this path, ask the vendor to confirm how the project expects forks to be maintained and which parts of the code are stable enough to change.",

How to build a connector in sequence

The sequence takes a processor that Hyperswitch does not support yet from a feasibility check to a connector that passes sandbox tests and receives webhooks through the router. Each step produces a checkable result so the team can stop or redirect early.

  1. Confirm the processor API covers required flows

    The engineering lead reads the processor's API documentation and sandbox terms and lists which payment operations it offers: authorize, capture, void, refund, sync, and any 3DS or payout operations the merchant needs. Gaps are recorded before any code is written, including authentication model, currency and payment method coverage, and whether webhooks are available for asynchronous status changes. The step is done when the team has a written list of supported and unsupported flows and has agreed which gaps are acceptable. Confirm sandbox access and test credentials at this stage, because every later step depends on them.

  2. Map each Hyperswitch flow to a processor call

    Using the Hyperswitch connector payment flows page as the reference, the team writes a table that pairs each Hyperswitch flow with one processor endpoint, the HTTP method, required fields and the expected response. Flows with no processor equivalent are marked as unsupported rather than approximated. The output is a reviewed mapping document that a second engineer has checked against the processor's documentation. Confirm the exact connector file locations and the trait or interface names against the current Hyperswitch repository before writing code, because the layout changes between releases.

  3. Implement request and response transforms

    Developers write the code that converts Hyperswitch's internal payment data into the processor's request format and converts processor responses back into Hyperswitch's types. Amounts, currency codes, billing details and error payloads need explicit handling, and any field the processor requires but Hyperswitch does not collect must be identified now. The step closes when unit tests cover each transform with recorded sample payloads from the sandbox and the code compiles against the current Hyperswitch core. Sensitive fields such as card data should be kept out of logs during this work.

  4. Map processor statuses to Hyperswitch statuses

    Each processor status value, including pending, requires action, declined and error states, is mapped to a Hyperswitch payment status. Ambiguous states are reviewed with the processor's documentation and the team decides how each one resolves, because wrong mappings cause incorrect retry, capture or refund behavior downstream. The output is a status table with one test case per mapping. The step is done when every processor status the sandbox can produce has a tested mapping and an explicit default for unknown values.

  5. Wire authentication and credentials into configuration

    The team adds the processor's authentication scheme to the connector, reading API keys, secrets or certificates from the deployment configuration rather than hardcoding them. Credentials are stored in the secret mechanism the deployment already uses, and the Control Center connector setup is tested so a merchant can enter them without code changes. The check is a successful authenticated sandbox call made through the configured connector in a running local stack, with a failed call using wrong credentials returning a clear error.

  6. Add webhook handling

    Developers implement the processor's webhook verification, parse the event payloads and map each event type to the status update Hyperswitch expects. Signature verification is tested with both valid and tampered payloads, and duplicate or out-of-order events are handled without changing a payment's final state. The check is a sandbox event that is delivered to the endpoint and arrives at the router, where the payment status updates as expected. Teams should confirm the webhook URL registration steps and endpoint paths with the processor and the current Hyperswitch documentation.

  7. Run sandbox tests across the full flow set

    The team runs an end-to-end test suite in the processor sandbox covering every flow marked as supported in step one, including successful, declined, requires-action and failed cases. Refunds, voids and captures are tested against payments created by the connector, and webhook-driven updates are compared with synchronous responses. The step is complete when the suite passes consistently, the results are recorded, and any unsupported flows are documented as known limits. The output is the evidence package for either internal release or an upstream contribution review.

How a payment request moves through a custom connector

The diagram starts at the merchant's API call to the Hyperswitch Router, which hands the payment to your custom connector code, and the connector calls the processor. The processor's webhook returns through the Router, which writes state to PostgreSQL. The card vault sits inside a trust boundary: whether raw card data ever reaches the connector depends on the vault model you choose, so check that before writing any card-handling flow.

Request and webhook paths through a custom connector, with the card vault boundary.

Mapping processor statuses, fields and flows to Hyperswitch

This table sets out the mapping work a connector build needs: each processor concept, the Hyperswitch side it maps to, and where the match is unclear. Build each row from the processor's own API documentation and the Hyperswitch connector payment flows page, then record the decision in your connector code and test notes. Rows marked as gaps need an explicit product decision before the connector ships.

Mapping areaWhat to map from the processorHyperswitch side and what to confirm
Authorize flowThe call that reserves funds or authorizes a card or wallet payment, and the response fields that identify the processor transactionMaps to the authorize step of the connector payment flows. Confirm which response field becomes the connector transaction reference stored for later capture, void and sync calls.
Capture flowThe call that settles a previously authorized amount, including whether partial captures are allowedMaps to capture. Confirm how the processor expresses partial capture and whether a capture can exceed the authorized amount.
Void flowThe call that cancels an authorization before capture, and any timing limits the processor appliesMaps to void (cancel). Confirm what the processor returns when a void is attempted after capture, since that case often needs a refund instead.
Refund flowThe call that returns funds after capture, including partial refunds and asynchronous refund statesMaps to refund. Confirm whether the processor reports refund success immediately or only after a later event, and how that state maps to Hyperswitch refund statuses.
Sync flowThe read endpoint that returns the current state of a payment or refund by referenceMaps to payment and refund sync. Confirm which identifiers the sync endpoint accepts so a missed response can be recovered without duplicate charges.
Payment status codesEvery processor status value for authorized, pending, requires action, captured, cancelled, failed and refunded statesMap each value to a Hyperswitch attempt status in your code. Flag any processor status with no clean equivalent, such as a state that is both authorized and under review, and record the chosen fallback.
Webhook event typesEvent names for payment, refund and dispute changes, plus the signature or verification method each event usesMap each event to the status update it should trigger. Confirm whether events can arrive out of order or more than once, and whether the processor retries delivery.
Error codes and decline reasonsDeclines, validation errors, timeouts and processor-side outages, with the codes and messages each returnsGroup errors into Hyperswitch error categories and decide which ones are retryable. Flag codes that mix card decline and technical failure, because retry behavior differs for each.

Testing a connector before it touches live money

Test a connector in layers, and set pass criteria before the first sandbox run. The first layer is unit tests for the request and response transforms, which convert Hyperswitch's internal payment data into the processor's API format and map each processor status back to Hyperswitch's status model. These tests need no network access and should cover every field mapping, currency and amount conversion, and error code translation. The second layer is sandbox runs, one per payment flow the connector implements: authorize, capture, void, refund, sync and any others your processor requires. Each flow should be run end to end through a self-hosted Hyperswitch stack so that the router, the database state and the webhook handling are exercised together, not just the connector code in isolation. Confirm with the processor which sandbox credentials and test card numbers it provides, and whether its sandbox behaves like production for declines and asynchronous events.

Negative tests come next, and they are where most connector defects surface. Test declines with each decline category the processor documents, timeouts on both the synchronous call and any status polling, partial failures where the processor accepts a request but the response never reaches Hyperswitch, and duplicate or out-of-order webhooks. Verify that retried requests do not create duplicate charges, and that a webhook replayed after a successful capture leaves the payment state unchanged. Finally, reconcile sandbox activity against the processor's own transaction and settlement reports, comparing counts, amounts, currencies and fees for every test run. The Hyperswitch docs describe a hosted sandbox and a Docker-based local setup for testing the stack, and both are useful here, but they test Hyperswitch, not your processor's behavior. Your team defines the pass criteria: the acceptable reconciliation variance, the maximum tolerated timeout rate, and the sign-off owners, written down before go-live.

Security rules for connector code

A connector sits between Hyperswitch and a processor that holds money and card data, so its code is part of your payment security perimeter. The cards below cover the rules to agree on before the first line is written, and the checks to run on each pull request.

Store and rotate processor keys

Processor API keys and signing secrets must live in your secrets manager or the deployment's configuration store, never in connector source, test fixtures or Control Center screenshots shared with others. Agree on who can read them, how they are injected into the router at runtime, and how a key is rotated without a deployment freeze. Ask the processor how long old keys remain valid during rotation, and test that the connector accepts the new key before the old one is revoked.

Request least-privilege processor keys

Most processors let you create restricted API keys with only the operations a connector needs, such as authorize, capture, refund and status lookup. Ask for a key that cannot change account settings, create users or export payment data unless a flow in your scope requires it. Document the permission set in the connector's README so a reviewer can compare it with the processor's key settings during each review.

Verify webhook signatures

Every inbound webhook must be checked against the processor's signature scheme before the payload changes any payment state. Reject events with missing or stale signatures, and compare signatures using constant-time functions. Confirm the exact signed content and timestamp rules with the processor's documentation, because an implementation that signs a re-serialized body will fail on real traffic. Test both a valid and a tampered payload in your suite.

Keep card data and secrets out of logs

Connector code often logs full request and response bodies while it is being built, and those bodies can contain card numbers, CVV values, authorization headers and webhook secrets. Set a redaction layer for known fields before any log line is written, and keep debug logging off in production. Review log output from a sandbox run before go-live, and confirm the logging configuration of the Hyperswitch deployment that will run the connector.

Confirm whether the connector sees raw cards

Decide early whether the connector ever receives a raw card number. If the connector only passes vault tokens or processor-hosted fields, it stays out of card data flows. If it receives raw card data, the deployment must fall within a vault model that the merchant can support, and PCI DSS responsibility sits with the merchant under the self-hosted in-house PCI model. Confirm the chosen model in the Hyperswitch vault documentation before writing any card-handling code.

In-house PCI model docs

Review code before each merge

Connector changes touch authorization amounts, refunds and status mapping, so a bug can move money incorrectly without an obvious error. Require a second reviewer for changes to auth headers, signature checks, logging and error handling. Run the security checks in your pipeline on every pull request, and keep a record of who approved each change so a later audit can trace it.

Contributing the connector upstream instead of keeping a fork

Contributing the connector upstream reduces the upgrade burden of carrying a private fork through Hyperswitch's monthly minor releases. A connector that lives only in your repository has to be re-merged, re-tested and re-validated against every new core release and every change to the shared connector interfaces, and that work recurs for as long as you run it. A connector accepted into the upstream codebase is maintained alongside the core, picks up refactors made by other contributors, and is covered by the project's own test runs. Before you commit to a design, ask whether the processor's flows fit the connector model the codebase already uses, because a connector that needs core changes to work is harder to upstream.

Before writing code, read the repository's contribution guidelines and check its current code of conduct, pull request template, licensing and sign-off requirements, and any rules about connector scope or who may propose new connectors. Confirm them in the repository itself, since they can change between releases. A contribution is expected to include the connector code, automated tests that cover each flow you implement, documentation for the processor's configuration and supported payment methods, and sandbox evidence showing real requests and webhook events against the processor's test environment. Keep that evidence (redacted request and response logs, test transaction identifiers and a list of the flows exercised) so reviewers can verify behavior without access to your credentials.

Acceptance is the maintainers' decision, and no one outside the project can promise it. Maintainers may request changes to naming, error mapping, configuration structure or test coverage, and they may decline a connector that they cannot test or maintain. Plan for that outcome: keep the connector isolated so that a private build remains possible if review stalls, and budget time for review rounds, which your internal team or your partner must staff. Ask your implementation partner to state in the written scope who handles review responses, rebases and retests after upstream changes, and what happens to the connector if the upstream version is delayed or not accepted.

Common connector failures and their fixes

This table lists failures that typically appear while building or upgrading a Hyperswitch connector, with the likely cause and the direction of the fix for each. Use it to triage problems before changing code, and confirm every specific detail against the Hyperswitch repository and the processor's own API documentation.

FailureLikely causeFix direction
Wrong payment states after a processor responseProcessor status codes are mapped to the wrong Hyperswitch attempt or intent status, often because a partial capture, void or pending state was collapsed into a generic success or failure.Map each processor status against the payment flow it belongs to, and test authorize, capture, void and refund paths separately. Confirm the mapping with the processor's status documentation.
Webhooks rejected by signature checksThe connector verifies a signature over a re-serialized body, or uses the wrong secret, header name or hashing method for the processor's webhook scheme.Verify signatures over the exact raw request bytes, load the secret from the configured credentials, and capture a real signed sample from the processor sandbox as a test fixture.
Duplicate captures after retriesA timeout or retried request is resent without an idempotency key, or the connector does not read back the processor's existing transaction before capturing again.Send the processor's idempotency mechanism where it exists, record the reference returned on first attempt, and check the current state before any retry. Confirm the processor's retry guidance.
Missing fields for regional processorsRequired billing address, country, state, tax or local identifier fields are absent for some markets, so the processor rejects requests that work in the sandbox.Add field requirements per country and payment method to the request mapping, and test with at least one request per target market. Confirm required fields in the processor's regional specification.
Refunds or voids returning unexpected errorsThe connector reuses the authorize reference format or sends a refund before the processor allows it, such as before settlement.Use the reference type the processor expects for each follow-up operation, and handle the processor's not-yet-settled response as a retryable state rather than a failure.
Breakage after a Hyperswitch upgradeTrait signatures, connector struct fields, configuration keys or shared types changed in a newer release, or a new required service dependency was introduced.Read the release notes and compatibility matrix for each version before upgrading, rebuild the connector against the target version, and run the connector test suite in a staging environment first.
Connector works in the sandbox but fails in productionSandbox credentials, endpoints or webhook registrations differ from live settings, or live accounts have settings that the sandbox does not enforce.Keep base URLs and credentials in configuration per environment, register webhook endpoints separately for live accounts, and confirm live account settings with the processor before go-live.

Questions teams ask before building a connector

How long does it take to build a Hyperswitch connector?

No duration is supplied for this work, so treat any timeline as something to scope, not assume. The main drivers are the quality and completeness of the processor's API documentation, how many payment flows you need (authorize, capture, refund, void, sync and webhooks are the usual set), and how quickly you get sandbox credentials and test cards from the processor. A processor with clear, versioned docs and a self-service sandbox moves much faster than one that needs a sales contact before you can make a test call. Ask the processor which flows they expose through their API and how long sandbox access takes before you commit to a plan.

What does it cost to build a connector in-house or with a partner?

The cost is mostly people time, and it splits into one-time build work and recurring upkeep. One-time work covers reading the processor's API, writing the connector in Rust against Hyperswitch's connector framework, mapping the processor's status codes and errors to Hyperswitch's model, building webhook handling, and testing across flows. Recurring work covers reacting to processor API version changes, updating the connector when Hyperswitch releases change internal interfaces, and handling new processor features. When you ask a partner for a quote, ask for the flows in scope, the test plan, who holds sandbox access, and what upkeep is included after go-live. No price is stated here.

Can our in-house engineers build a Hyperswitch connector themselves?

They can if they have strong Rust skills, experience with payment APIs and time to read the existing connectors closely before writing code. The skills that matter most are idempotent request handling, careful money and currency handling, webhook signature verification and an understanding of payment state machines, since a mistake in any of these can cause double charges or lost settlement data. Teams without that payment background usually spend most of their effort on edge cases the processor documents poorly. Check whether anyone on your team has shipped a payments integration in production before you decide to build in-house.

How do we keep a custom connector working across Hyperswitch upgrades?

Keep the connector close to upstream conventions, pin the Hyperswitch version you test against and run a regression suite against each new release before upgrading. Hyperswitch ships regular minor releases, and each one comes with a compatibility matrix for Control Center and web client versions, so check it at every upgrade. Keep the connector in a branch or contribution you can rebase, rather than hand-editing core files, because that is what makes later merges expensive. Plan a named owner for these upgrades from the start, since an unmaintained connector tends to break silently when the core changes.

When should we contribute a connector upstream instead of keeping a fork?

Contribute upstream when the connector serves processors other merchants also use, when the code follows the project's conventions and when you can commit to reviewing feedback and keeping it passing tests. A private fork is easier to start but means you carry every upgrade, security fix and review change alone. Upstream contribution moves maintenance cost to a shared project, though it also means your design may be changed to fit the project. Before you start, read the contribution guidelines in the main repository and check whether a connector for the processor is already in progress, so you do not duplicate work.

What do we need from the processor to build a connector?

You need API documentation for every flow in scope, sandbox or test credentials, a set of test cards and scenarios that cover declines, 3DS challenges and refunds, and a clear webhook specification including the signing method. You also need to know which card data the processor accepts, since raw card handling usually requires separate approval from the processor and, for merchants, evidence of PCI DSS compliance. Ask the processor for a named technical contact, the rate limits and error code list, and whether there is a changelog for API versions. Missing any of these usually turns into delays later in the build.

What security checks should a new connector pass before go-live?

Before go-live, verify that API keys and secrets are stored in your secrets manager or the deployment's configured secret store, never in code or logs, and that webhook signatures are verified before any event changes payment state. Test that card data never reaches logs or unencrypted storage, that retries cannot create duplicate charges and that error messages do not leak processor credentials. If the connector handles raw card data, the security review also has to cover your PCI DSS scope. Run a security test against the finished connector and its webhook endpoint before production traffic reaches it.

How DeployOpen scopes and delivers a custom connector

DeployOpen approaches a custom Hyperswitch connector as a fixed-scope engagement: the processor's API, the payment flows you need and the test plan are agreed in writing before code is written. The work is then built inside your own Hyperswitch deployment, tested against the processor's sandbox, documented for your engineers and handed over with a supported path forward.

How we scope

  • Written scope lists the processor, the payment flows the connector must cover and the payment methods in use.
  • Scope records which processor sandbox and credentials are available for testing before build starts.
  • Scope names the Hyperswitch version and deployment model the connector will target, so the work matches your stack.

How we build

  • Connector code is built in your Hyperswitch repository or fork and follows the project's existing connector structure.
  • Each payment flow is implemented and tested in order, with webhook handling and status mapping checked against the processor's documentation.
  • Credentials and secrets are kept in your secret store and never written into code, configuration files or test fixtures.

How we hand over

  • Handover includes a test report covering each flow, the sandbox results and any known gaps the scope left open.
  • Documentation covers configuration keys, required credentials, webhook endpoints and the operational runbook for your team.
  • We walk your engineers through the code and agree a plan for contributing the connector upstream or keeping it maintained.

How we support

  • Ongoing support covers connector updates when the processor changes its API or Hyperswitch releases affect the connector.
  • Retainers can include continuous testing against the processor sandbox and review of each Hyperswitch upgrade.
  • Support terms, response expectations and upgrade coverage are written into the retainer before work starts, and no prices are set here.

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.