One API for fiat + crypto payments. 14 fiat providers. 4 crypto on/off-ramp drivers. Multi-provider routing. Zero runtime deps. MIT.

npm install paybridge
npm version CI status MIT license TypeScript Discord

One API

Same createPayment call works against Stripe, PayStack, PayFast, Adyen, Mollie, Razorpay, Square, Mercado Pago, Pesapal, Flutterwave, Yoco, Ozow, Peach Payments, SoftyComp. Switch providers by changing one config line.

Smart routing

PayBridgeRouter picks the cheapest, fastest, or highest-success-rate provider per transaction. Circuit breaker. 429-aware fallback. Webhook idempotency.

Real outcomes

The successRate strategy ranks providers using your actual transaction history from the ledger β€” not vendor rate cards. Static fee tables lie.

Quick Start

Stripe PayStack PayFast Mollie Flutterwave
import { PayBridge } from 'paybridge';

const pay = new PayBridge({
  provider: 'stripe',
  credentials: { apiKey: process.env.STRIPE_API_KEY },
  sandbox: true,
});

const payment = await pay.createPayment({
  amount: 299,
  currency: 'ZAR',
  reference: 'INV-001',
  customer: { name: 'John Doe', email: 'john@example.com' },
  urls: {
    success: 'https://example.com/success',
    cancel:  'https://example.com/cancel',
    webhook: 'https://example.com/webhook',
  },
});

console.log(payment.checkoutUrl);

Supported Providers

Fiat providers (14)

Provider Region One-time Subscriptions Refunds Webhooks Status
SoftyCompSouth Africaβœ…βœ…βœ…βœ…Production
YocoSouth Africaβœ…β›”βœ…βœ…Production
OzowSouth Africaβœ…β›”β›”βœ…Production
PayFastSouth Africaβœ…βœ…βœ…βœ…Production
Peach PaymentsSouth Africaβœ…β›”βœ…βœ…Production
PayStackAfricaβœ…βœ…βœ…βœ…Production
FlutterwaveAfricaβœ…βœ…βœ…βœ…Production
PesapalEast Africaβœ…β›”βœ…βœ…Production
StripeGlobalβœ…βœ…βœ…βœ…Production
AdyenGlobalβœ…β›”βœ…βœ…Production
MollieEuropeβœ…β›”βœ…βœ…Production
SquareUS/Canada/UKβœ…β›”βœ…βœ…Production
RazorpayIndiaβœ…βœ…βœ…βœ…Production
Mercado PagoLatin Americaβœ…βœ…βœ…βœ…Production

Crypto on/off-ramp providers (4)

Provider On-ramp Off-ramp Quote Webhooks Status
MoonPayβœ…βœ…βœ…βœ…Production
Transakβœ…βœ…βœ…βœ…Production
Ramp Networkβœ…βœ…βœ…βœ…Production
Yellow Card⚠️⚠️⚠️⚠️Experimental

βœ… Supported | β›” Not supported by upstream API | ⚠️ Experimental (spec unverified)

Architecture

                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚        Your app         β”‚
                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚ paybridge SDK
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚     PayBridgeRouter     β”‚
                  β”‚  cheapest/fastest/...   β”‚
                  β”‚  circuit breaker        β”‚
                  β”‚  webhook idempotency    β”‚
                  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚     β”‚     β”‚
                  β”Œβ”€β”€β”€β”€β”€β”΄β”€β” β”Œβ”€β”΄β”€β”€β”€β” β”Œβ”΄β”€β”€β”€β”€β”€β”€β”
                  β”‚Stripe β”‚ β”‚Mollieβ”‚ β”‚PayFastβ”‚ ...
                  β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜

Operations

Drift detection

Catches the moment a provider silently changes their API. The Square endpoint moved between releases β€” paybridge drift-check would have flagged it before production traffic broke.

paybridge drift-check --capture
# later
paybridge drift-check \
  --webhook-url https://hooks.slack.com/...

Reconcile

Catches missed webhooks. Diff your DB's expected statuses against each provider's current state.

psql -t -c "SELECT provider, reference, \
  status AS expected_status \
  FROM payments WHERE status='pending'" \
  | paybridge reconcile

Status observatory

Independent multi-provider monitoring at status.whatshubb.co.za. Vendor status pages + HTTP probes + sandbox health, three signals per provider, divergence detection surfaces "vendor says fine, our probes disagree" moments.

Where to go next