Skip to content

Core Concepts

Understand the fundamental concepts, workflows, and logical building blocks that power the OwnPay payment orchestration engine.


📐 Core Concept Guides

Browse these guides to understand how data is managed, how payments are routed, and how isolation is enforced.

GuideDescription
🏢 Brands & StoresHow OwnPay isolates stores, credentials, ledgers, and custom domains using tenant scoping (merchant_id).
💳 Payment FlowThe life cycle of a transaction, from creating payment intents via API to customer redirection, verification, and settlement.
🔌 Gateways & RoutingUnderstanding global gateway adapters, manual offline methods, fee rules, and currency conversion logic.
🔗 Webhooks & EventsHow outbound event notifications are generated, signed (HMAC-SHA256), delivered, and retried.
🛡️ User Roles & PermissionsSystem super-administrators vs. brand-scoped staff, and mapping RBAC permissions.

Architecture Overview

At its core, OwnPay acts as an orchestrator sitting between your online application (merchant store) and payment networks (gateways).

┌─────────────────┐
│ Merchant App    │ (WooCommerce, SDKs, etc.)
└────────┬────────┘

         │ REST API (Bearer Token)

┌────────────────────────────────────────────────────────┐
│ OwnPay Core                                            │
│                                                        │
│  - Brand Isolation (tenant scoped DB queries)          │
│  - Double-Entry Ledger (bcmath money precision)        │
│  - Event Hook Pipeline (EventManager)                  │
└────────┬───────────────────────────────────────┬───────┘
         │                                       │
         │ Adapter Interface                     │ Adapter Interface
         ▼                                       ▼
┌─────────────────┐                     ┌─────────────────┐
│ Gateway Adapter │                     │ Gateway Adapter │
│ (e.g. Stripe)   │                     │ (e.g. bKash)    │
└────────┬────────┘                     └────────┬────────┘
         │                                       │
         ▼ API / Redirect                        ▼ API / Redirect
┌─────────────────┐                     ┌─────────────────┐
│ Stripe API      │                     │ bKash API       │
└─────────────────┘                     └─────────────────┘

Every database operation inside the core checks the active merchant_id to ensure strict tenant boundary safety.


See Also