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.
phone_iphoneMFS Carrier Shortcode & Gateway Routing
Official Bangladesh mobile banking carrier shortcodes verified by the SwapnoPay Android SIM Bridge.
keyMerchant API Credentials & Webhook Security
Cryptographically signed credentials for direct HTTP REST calls and HMAC-SHA256 webhook verification.
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.
terminalLive Console Terminal Stream
Real-time output stream of REST API calls, Socket.io events, and HMAC webhook deliveries.
rocket_launchMerchant Production Onboarding Wizard
Follow these 4 steps to configure, test, and launch your automated MFS checkout integration using standard HTTP REST APIs.
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.
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.
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
POSTJSON 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.ioevent to the checkout widget, and dispatches a signedHMAC-SHA256webhook 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
order_id, tran_id, and checkout_url.trx_id and sender_number for an order awaiting carrier SMS confirmation.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
- Dedicated Android Device: Install the SwapnoPay Merchant App on an Android phone containing your active bKash/Nagad/Rocket/Upay SIM cards.
- OS Background Permissions: Grant
RECEIVE_SMS,READ_SMS, andPOST_NOTIFICATIONSpermissions, and set Battery Usage to Unrestricted so the foreground socket & WorkManager queue never sleep. - HTTPS Webhook Endpoint: Configure a public TLS (
https://) callback URL in the Dashboard and verify it returnsHTTP 200within 5 seconds. - Idempotent Fulfillment: Store
trx_idwith aUNIQUEdatabase constraint in your application database so replayed webhooks never double-credit a customer. - Switch Environment to Live: Replace
sk_sandbox_...with your livesk_live_...key and verify device online status viaGET /v1/payment/device-status.