Wiring custom PHP applications to OwnPay via the Merchant API
A step-by-step guide to executing headless checkouts and verifying HMAC webhooks using Laravel and OwnPay's Merchant API.
A guide to pairing regional gateways like bKash and SSLCommerz with global processors to lower checkout abandonment in emerging markets.
Expanding e-commerce into South Asia presents a clear challenge. International card networks like Stripe handle global credit cards, but domestic buyers often rely on regional mobile financial services and local gateways. If your checkout only accepts standard credit cards, buyers in markets like Bangladesh drop out when they cannot pay with bKash, Nagad, or SSLCommerz.
Solving this does not require building separate checkout flows for every region. Running a unified, self-hosted payment gateway gives you direct control over your checkout experience. When deciding between third-party processors, custom engineering, or independent hosting, our previous analysis on comparing payment stacks: SaaS, custom builds, and self-hosted engines highlights how maintaining data custody and avoiding per-transaction platform fees gives merchants long-term flexibility.
This guide walks through configuring local South Asian payment methods alongside global credit card processors inside OwnPay on a single server setup.
OwnPay is an open-source payment gateway engine licensed under the AGPL. It runs on standard PHP server environments. Setting up the base instance takes under five minutes.
Because OwnPay takes a 0% platform fee on transactions, every dollar processed flows directly to your payment provider accounts. Once installed, the administration dashboard allows you to manage plugins, configure credentials, and monitor transaction ledgers.
OwnPay isolates payment integrations into modular plugins using an action and filter hook pattern. You do not modify core application code to add new payment providers. Installing regional gateway plugins allows you to run regional payment gateway integration options like bKash, Nagad, and SSLCommerz alongside global options like Stripe or PayPal.
To configure Stripe, navigate to the plugin catalog in your dashboard. Input your API keys. This handles standard debit and credit card checkouts for international customers. The plugin handles charge authorization and settlement events automatically.
To capture regional traffic, install the plugins for bKash, Nagad, or SSLCommerz. Each regional provider requires its own credentials, such as merchant IDs and secret keys.
Each plugin isolates its credentials in your database on your own server. Customer payment details remain on your infrastructure, ensuring data privacy.
Having multiple payment gateways does not mean presenting a fragmented user experience. OwnPay offers a white-label checkout on your own domain. Customers see your logo, your colors, and your domain without platform branding.
When a buyer reaches checkout, the engine exposes active payment methods based on your configuration. A customer in Dhaka can select bKash, Nagad, or SSLCommerz to pay in local currency. An international customer can select Stripe to pay in USD. The entire transaction executes under your domain's SSL certificate.
Processing payments across different currencies and gateway structures requires strict accounting. OwnPay uses double-entry bookkeeping to maintain ledger balance. Every completed transaction generates matching ledger entries automatically. A payment records a debit to customer receivables and a credit to merchant revenue.
When a payment completes across any configured gateway—whether via Stripe or bKash—OwnPay fires event hooks. You can attach custom business logic to these events without touching core files. For details on handling post-payment logic and dispatching webhooks, see our guide on how to write custom post-payment hooks in OwnPay.
Developer teams can listen for payment completion events using the WordPress-style hook system:
Hook::on('payment.completed', function ($trx) { Notification::send($trx->merchant, $trx); });
Signed HMAC webhooks can also inform your fulfillment backend, mobile app, or external systems. The system exposes REST API endpoints, such as retrieving payment states via GET /api/v1/payments/{payment_id}.
Checkout abandonment drops when payment friction disappears. Providing local payment methods alongside established global options removes geographic barriers for buyers in emerging markets. By self-hosting your payment infrastructure with OwnPay, you eliminate platform fees, retain ownership of customer data, and deliver localized checkout experiences worldwide.
A step-by-step guide to executing headless checkouts and verifying HMAC webhooks using Laravel and OwnPay's Merchant API.
An honest look at transaction fees, data custody, and engineering overhead across three payment infrastructure models.
An analysis of how open-source self-hosted payment software gives developers ledger accuracy and brand control without platform transaction fees.