SwapnoPay Console

Developer workspace
Gateway Online
Enterprise Developer Console

Direct REST API & Automated MFS Gateway

Manage live API credentials, test real MFS carrier SMS verification, and inspect signed HMAC-SHA256 webhook deliveries. No proprietary SDK required.

API reference
API Volume (24h)
1,482
● Live Gateway Telemetry
Match Success Rate
99.85%
● Atomic TrxID Regex Match
Avg Webhook Latency
48ms
● Signed HMAC-SHA256
Active Devices
2 Online
● bKash + Nagad SIMs

phone_iphoneMFS Carrier Shortcode & Gateway Routing

Official Bangladesh mobile banking carrier shortcodes verified by the SwapnoPay Android SIM Bridge.

bKash (16247)
Active
Nagad (16167)
Active
Rocket (16216)
Active
Upay (16268)
Active

keyMerchant API Credentials & Webhook Security

Cryptographically signed credentials for direct HTTP REST calls and HMAC-SHA256 webhook verification.

pk_sandbox_swapnopay_88f92a1109
sk_sandbox_swapnopay_99a83b2201
whsec_e9a8f27b14092c68e1a

paymentsReal Live Gateway Examples

Production gateway endpoints, hosted checkout pages, merchant callbacks, and live verification flows for MFS payments.

speedCore Platform Infrastructure

Real-time operational status for the SwapnoPay API Gateway, Socket.io Engine, and SMS Receiver.

API Gateway Router
Realtime Socket.io Engine
PostgreSQL / Admin Supabase
SMS Automation Receiver

terminalLive Console Terminal Stream

Real-time output stream of REST API calls, Socket.io events, and HMAC webhook deliveries.

[00:00:00] [OK] SwapnoPay Developer Console initialized. Ready for live REST API and webhook testing.

rocket_launchMerchant Production Onboarding Wizard

Follow these 4 steps to configure, test, and launch your automated MFS checkout integration using standard HTTP REST APIs.

1. Provision Merchant Workspace & API Keys Completed — Dynamic Merchant ID, Secret Key, and Webhook Secret active
2. Configure MFS Receiving Numbers & Webhook URL Pending — Set your target webhook callback URL on the Dashboard or Sandbox
3. Create Order & Verify Carrier SMS Matching Pending — Create a real order and test bKash/Nagad/Rocket/Upay SMS verification
4. Verify HMAC-SHA256 Signature & Go Live Pending — Validate X-SwapnoPay-Signature on your backend webhook receiver

scienceProduction Payment Flow Sandbox

Zero mocks: Dispatches real REST orders, simulates genuine carrier SMS parsing, and delivers signed HMAC webhooks with live round-trip latency.

Status: Ready to initialize real sandbox checkout.

receipt_long1. Real Order Parameters

Set real checkout payload parameters to create a trackable transaction.

cell_tower2. Carrier SMS Interception & Atomic Match

Triggers real backend carrier SMS parsing, updates ledger to PAID, and emits Socket.io events.

⚖ Dispute & Edge Case Scenarios

Simulate real timeout expirations and customer dispute appeals.

timelineOrder Lifecycle Pipeline

Real-time order transitions pushed by backend WebSocket & database matcher.

1. Order Created (PENDING) Awaiting order initialization
2. SMS Intercepted by Gateway Awaiting carrier broadcast regex match
3. Transaction Matched (PAID) Atomic database update & ledger confirmation
4. Outbound Webhook Delivery Real signed HMAC SHA-256 payload dispatch

travel_exploreInteractive API Endpoint Explorer

Test SwapnoPay API endpoints live directly inside your browser console.

Click "Execute Endpoint Call" to dispatch request...

codeDirect HTTP REST & Checkout Widget Code Generator

Zero third-party SDK required. Generate production-ready standard HTTP REST requests, hosted Checkout Widget embeds, and HMAC-SHA256 webhook verification snippets using native language libraries.

// Code generates dynamically...

hubWebhook Event Delivery Ledger

Inspect payload dispatches, HTTP status responses, and HMAC signatures. Click any row to inspect full payload.

Timestamp Target Webhook URL Event Type HTTP Status Latency Action
No webhook events logged yet in this session. Run a Sandbox simulation to trigger deliveries.

verified_userSwapnoPay Enterprise Production Integration Guideline

Complete production blueprint for integrating SwapnoPay using standard HTTPS REST endpoints, Hosted Checkout Widget, Android SIM Bridge, and HMAC-SHA256 Webhooks — with zero external SDK dependencies.

1. Zero-SDK Production Architecture

SwapnoPay is intentionally engineered around Direct HTTP REST APIs + Standard Webhooks + Hosted Checkout. You do not need to install or maintain any third-party NPM, Composer, PyPI, or Go SDK packages, nor any CMS plugin.

  • Order Creation: Your backend sends a standard POST JSON request over HTTPS to register a pending order intent (amount, tran_id, cus_phone, callback_url).
  • Customer Checkout: Redirect the customer or embed widget.html?merchant_id=...&amount=...&order_id=... inside an <iframe>.
  • Android SIM Bridge: Your dedicated Android phone running the SwapnoPay Merchant App receives the carrier SMS from bKash (16247), Nagad (16167), Rocket (16216), or Upay (16268) and forwards it to POST /v1/payment/verify.
  • Instant Settlement & Webhook: The gateway atomically verifies the TrxID and amount, emits a real-time Socket.io event to the checkout widget, and dispatches a signed HMAC-SHA256 webhook to your server.

2. API Authentication & Key Isolation

All server-to-server REST calls must authenticate using your sk_live_... (or sk_sandbox_...) Secret API Key via either header:

Authorization: Bearer sk_live_your_secret_api_key
x-api-key: sk_live_your_secret_api_key
Content-Type: application/json

Security Rule: Never expose your sk_live_... Secret Key or whsec_... Webhook Secret in client-side browser JavaScript or mobile app bundles. Only pass merchant_id and order_id to the public Checkout Widget.

3. Production REST API Endpoints Reference

POST /v1/developer/sandbox/order  |  POST /functions/v1/create-order
Registers a trackable payment order intent and returns order_id, tran_id, and checkout_url.
GET /v1/payment/config?merchant_id={UUID}
Returns active MFS channels (bKash, Nagad, Rocket, Upay), receiving wallet numbers, QR codes, and live Android device heartbeat status.
POST /v1/payment/notify
Submits customer-reported trx_id and sender_number for an order awaiting carrier SMS confirmation.
POST /v1/payment/verify
Receives raw carrier SMS broadcast from the SwapnoPay Android Worker, extracts amount & TrxID via regex, and settles matching pending orders.
GET /v1/payment/status/{order_id}
Queries authoritative order state (PENDING, PAID, EXPIRED) for server-side reconciliation.

4. Webhook HMAC-SHA256 Verification & Idempotency

Every outbound webhook POST request includes the X-SwapnoPay-Signature header in the format t=<unix_timestamp>,v1=<hex_hmac_sha256>. The signature is computed over ${timestamp}.${rawRequestBody} using your Webhook Secret:

// Standard Node.js Express Webhook Verification (Zero SDK)
const crypto = require('node:crypto');

app.post('/api/swapnopay/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const sigHeader = req.headers['x-swapnopay-signature'] || '';
  const parts = Object.fromEntries(sigHeader.split(',').map(p => p.split('=')));
  if (!parts.t || !parts.v1) return res.status(400).send('Malformed signature header');

  // 1. Replay Attack Protection: Reject webhooks older than 5 minutes (300s)
  if (Math.abs(Math.floor(Date.now() / 1000) - Number(parts.t)) > 300) {
    return res.status(401).send('Webhook timestamp expired');
  }

  // 2. Compute HMAC-SHA256 over "${timestamp}.${rawBody}"
  const rawBody = req.body.toString('utf8');
  const expected = crypto
    .createHmac('sha256', process.env.SWAPNOPAY_WEBHOOK_SECRET)
    .update(`${parts.t}.${rawBody}`)
    .digest('hex');

  if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1))) {
    return res.status(401).send('Invalid HMAC signature');
  }

  const event = JSON.parse(rawBody);
  // 3. Enforce idempotency using event.trx_id & event.order_id before fulfilling order
  res.status(200).json({ received: true });
});

5. Android SIM Bridge & Production Go-Live Checklist

  1. Dedicated Android Device: Install the SwapnoPay Merchant App on an Android phone containing your active bKash/Nagad/Rocket/Upay SIM cards.
  2. OS Background Permissions: Grant RECEIVE_SMS, READ_SMS, and POST_NOTIFICATIONS permissions, and set Battery Usage to Unrestricted so the foreground socket & WorkManager queue never sleep.
  3. HTTPS Webhook Endpoint: Configure a public TLS (https://) callback URL in the Dashboard and verify it returns HTTP 200 within 5 seconds.
  4. Idempotent Fulfillment: Store trx_id with a UNIQUE database constraint in your application database so replayed webhooks never double-credit a customer.
  5. Switch Environment to Live: Replace sk_sandbox_... with your live sk_live_... key and verify device online status via GET /v1/payment/device-status.
✨ Notification message