Preview: SendMock has no stable release yet. These docs follow develop.
SendMock
Payments

Gateways

The emulated payment providers. What each offers at checkout, its credentials, what it sends back to your app, and your own gateways.

Try it in the demo.

A gateway is one emulated payment provider: Stripe, PayPal, SSLCommerz, bKash, Native, or one you add. Gateways are data, not code: what a gateway offers, what its redirect carries and what its notification looks like are all editable, and Reset to default brings a built-in back.

The Gateways screen

What it solves

  • A gateway SendMock does not ship. Add it from blank or from the closest built-in, with its own fields and signature. See Advanced: create a gateway.
  • A built-in that differs from your account's setup: another event name, an extra redirect field, a method your merchant account does not offer.
  • Credentials your app checks, such as SSLCommerz's store id and password, in one place, masked.

How it connects

Gets fromSends to
Methods: the ones it offers at checkout, in orderthe checkout page: which methods and steps it shows
your app's API calls at /providers/<key>/... on port 8026 (a custom gateway answers session init and validation)redirects to your app, with the fields set on the Redirect tab
Settings > Payments: merchant name and currencynotifications to its notification endpoint (a webhooks endpoint), logged in Deliveries

Use it

  1. Press Edit SSLCommerz.
  2. In Checkout, see the methods it offers (Card, bKash, Nagad, Rocket, DBBL Nexus, City Touch, BRAC iBanking), and press Open a test checkout.
  3. Pay with a test bKash number. Back on the gateway, the Redirect and Notification tabs show exactly what was sent, with a live preview.

Everything on this screen

The table

Name, key, the methods offered, the notification endpoint, Built-in or Custom, Modified once a built-in is edited, and an enabled switch. Add gateway asks for a name, a key (the provider value in the API and in /providers/<key>/... paths) and Start from (a built-in to copy, or blank).

The gateway sheet

TabHolds
Generalname, key (fixed after creation), accent colour (the checkout page uses it), enabled
CheckoutMethods offered, in order: Add a method, move up and down, remove; and Open a test checkout, which creates a test payment on this gateway and opens its page
Merchantcredentials as name and value rows (store id, secret key, ...), secrets masked with a reveal that asks first; the Notification endpoint
RedirectGET or POST, and the fields sent back to your app: a name and a template each, sent Always or Only on success (like PayPal's PayerID)
NotificationJSON or Form, the gateway's event name for each native event (blank sends nothing for it), the body template and header templates (for signatures)

Beside Redirect and Notification, a Preview renders them against a chosen payment, event and redirect outcome, with secrets masked and problems under each part. A gateway with template errors cannot be saved ("Fix 1 template error to save").

What templates can read

ValueHolds
paymentid, reference, amount_minor and amount_major, currency, status, failure code, customer, method, provider ids, metadata
eventid, the native type, the gateway's name for it, created as Unix seconds
redirectoutcome (success, fail or cancel) and status
merchantthe credentials by name, for example merchant.store_passwd

Plus the template functions and filters, and uuid(), random_hex(length), now_iso() and stripe_signature(secret) for signature headers. A form body is written encoded, for example tran_id={{ payment.reference | urlencode }}&status=....

Built-in and custom

A built-in can be edited and disabled but not deleted; it shows Modified once edited, and Reset to default (asks first) restores it. A custom gateway can be deleted while no payment uses it.

Every control and text, one by one: Gateways in depth.

Customize

The full walkthrough, from the provider's docs to a working checkout and a seed export: Advanced: create a gateway. An AI agent can do it for you: AI: create a gateway with AI.

From the CLI, API and AI

On this page