Payflow Bridge is an extensible payment orchestration layer purpose-built for e-commerce ecosystems that manage high-volume digital goods transactions. Inspired by the simplicity of gateway-specific integrations like Payhubix for Easy Digital Downloads, this repository reframes the challenge: instead of tying your store to a single provider, Payflow Bridge acts as a neutral, configurable middleware that routes payments through any supported gateway — including Payhubix, Stripe, PayPal, and custom endpoints — based on dynamic rules such as currency, region, cart value, or customer segment.
This is not merely a "multi-gateway wrapper." It is a decision engine with built-in fallback logic, transaction logging, and real-time settlement reporting. Digital store owners, subscription platforms, and SaaS merchants can now decouple their checkout experience from payment provider lock-in, gaining resilience, compliance flexibility, and operational control.
Under this heading, you will find the source code release. This repository is self-contained and ready for integration testing.
Define routing policies via JSON configuration. Route transactions to the lowest-cost provider for a given region, retry with an alternative gateway on failure, or send high-value orders through a manually reviewed channel.
Payflow Bridge exposes a unified API that mirrors common e-commerce actions (charge, refund, subscribe, webhook). If you already integrate with a specific gateway, switching requires only a configuration change — no code rewrites.
Build custom connectors using a standardized interface. The included PayhubixConnector demonstrates how to wrap an existing gateway’s SDK. Community contributors can submit connectors for regional payment methods like iDEAL, Boleto, or Alipay.
Every payment attempt, retry, and failure is logged with a structured payload. Use the built-in exporter to send logs to your data pipeline (e.g., Elasticsearch, S3) for compliance and analytics.
The response engine returns error messages and status descriptions in the user’s preferred language (based on Accept-Language header or cart locale). Translations for 12 languages are bundled.
A lightweight, embeddable web interface shows real-time balances, success rates, and pending settlements across all gateways. No external dependencies — runs on a single static page.
Outbound webhooks notify your operations channel (Slack, Discord, or custom HTTP endpoint) of any gateway anomaly — sudden drop in success rate, prolonged latency spike, or authentication failure.
Digital goods merchants face unique challenges: high transaction volumes, global customer bases, and thin margins. Relying on a single gateway introduces risk:
- Regional downtime: A provider may throttle or block traffic from certain countries.
- Cost variance: Processing fees differ wildly by region and card type.
- Compliance drift: GDPR, PSD2, or local payment mandates may require a local processor.
Payflow Bridge treats payment diversity as a feature, not an afterthought.
The integration surface is intentionally minimal. After importing the core library, you instantiate the bridge with your gateway configurations:
const Bridge = require('payflow-bridge');
const bridge = new Bridge({
gateways: {
payhubix: { apiKey: process.env.PAYHUBIX_KEY, sandbox: true },
stripe: { secretKey: process.env.STRIPE_SECRET, webhookSecret: process.env.STRIPE_WHSEC }
},
routes: [
{ if: { currency: 'EUR' }, use: 'payhubix' },
{ if: { amount_lt: 50 }, use: 'stripe' },
{ default: 'payhubix' }
]
});
const result = await bridge.charge({
amount: 29.90,
currency: 'EUR',
description: 'Premium eBook - Volume II'
});No lengthy setup scripts. No external databases required for basic routing. The configuration file (bridge.config.json) supports environment variable interpolation.
| Connector | Status | Notes |
|---|---|---|
| Payhubix | Stable | Full charge, refund, subscription support |
| Stripe | Stable | Includes SCA-ready checkout session |
| PayPal | Beta | Orders API only; no subscriptions yet |
| Custom HTTP | Alpha | Implement any REST gateway via config |
Connectors are activated by placing their configuration block in bridge.config.json. No additional npm install is required for bundled connectors.
- Cross-region digital storefront: Use Payhubix for European customers (lower EU processing fees) and Stripe for North America.
- Subscription continuity: If the primary gateway fails to renew a subscription, the bridge automatically retries with a secondary provider.
- One-click testing sandbox: Run all gateways in sandbox mode simultaneously to compare responses, latencies, and error schemas.
The bridge.config.json file supports:
{
"fallbackBehavior": "immediate",
"retryCount": 2,
"retryDelayMs": 500,
"webhookUrl": "https://hooks.slack.com/services/...",
"logLevel": "verbose"
}fallbackBehavior:"immediate"tries the next gateway on failure."defer"marks the order for manual review.retryCount: Maximum automatic retries before marking the transaction as failed.webhookUrl: Optional endpoint for operational alerts.
- No credit card data is stored by the bridge. All sensitive payloads are forwarded directly to gateway SDKs.
- API keys are read from environment variables or a
.envfile (never hardcoded). - Outbound webhooks include a signed payload (HMAC-SHA256) for verification.
- The reconciliation dashboard can be disabled in production environments.
We believe in testing payment logic without incurring real gateway costs. The repository includes:
- A mock gateway that simulates success, failure, and timeout scenarios.
- A scenario runner that replays recorded transaction sequences.
- Integration tests that run against each connector’s sandbox environment.
Test coverage targets are: unit tests at 90%+, integration tests at 75%+.
Contributions are welcome in the form of:
- New connector implementations for regional or niche gateways.
- Localization files for additional languages.
- Improvements to the routing engine (e.g., AI-based cost prediction).
Please open an issue first to discuss changes. All contributions must include tests and documentation updates.
This software is provided "as is," without warranty of any kind. Payment gateway integrations rely on external services that may change their APIs or terms of service. Payflow Bridge is not affiliated with Payhubix, Stripe, PayPal, or any mentioned third party. You are responsible for ensuring compliance with applicable financial regulations in your jurisdiction. The maintainers assume no liability for transaction losses, double charges, or gateway downtime caused by misconfiguration or connector bugs.
This project is licensed under the MIT License — see the LICENSE file for details. You are free to use, modify, and distribute this software in commercial and non-commercial projects, provided the original copyright notice is included.
Payflow Bridge — because your payment stack should bend, not break. Built for the 2026 digital commerce landscape.
Final release package available under this section. Please refer to the release tags for versioned archives.