Merchant-facing layer
Merchant onboarding workflow, hosted checkout, payment links, API, subscriptions (later), dashboard, transaction search, refunds, disputes, webhooks and reconciliation.
Consulting · Engineering architecture & implementation blueprint · 30 November 2026
A specific implementation blueprint for a Trinidad and Tobago merchant gateway and payment-facilitation platform, alongside the legal, acquiring, settlement and market-access work required to make it usable.
This document supersedes the earlier HTML prototype as the architecture handoff. It preserves the previous research-platform requirements while separating them from the payment transaction system. The architecture is documented using all 12 arc42 sections.
The gateway is a commercial payment product. The OPRL website is a collaborative research and reform platform. They are separate deployments, separate data stores and separate security domains. The gateway must connect to an acquiring institution; it must not pretend to be the card network, issuer, settlement bank or FX dealer.
Our software owns merchant experience and payment orchestration. The contracted acquirer/processor owns the card-network connection and performs regulated acquiring/settlement functions as set out in the contract. The merchant's bank account receives settlement directly.
Merchant onboarding workflow, hosted checkout, payment links, API, subscriptions (later), dashboard, transaction search, refunds, disputes, webhooks and reconciliation.
Master/sub-merchant model, acquirer API, scheme registration, 3DS, merchant underwriting, fee schedule, settlement currencies, chargeback allocation and reserves.
This is not the gateway. It is the public workspace for collecting merchant experiences, researching laws and institutions, tracking reforms, and managing contributor review.
Requirements, stakeholders and quality goals · Official arc42 guidance ↗
OPRL is a collaborative evidence and delivery programme. It has two distinct software systems: (A) the merchant payment platform, and (B) the OPRL research, contributor and reform platform. They share evidence and governance, not payment credentials or customer-fund flows.
| Priority | Goal | Acceptance evidence |
|---|---|---|
| 1 | Financial correctness | Every capture/refund/fee/settlement event traceable; balanced journal; daily reconciliation. |
| 2 | Security and card-data minimisation | No PAN/CVV in OPRL systems; secrets managed; security testing and partner sign-off. |
| 3 | Resilience and recoverability | Provider timeout/duplicate/retry scenarios tested; recoverable event log and database backups. |
| 4 | Merchant portability | Provider adapter boundary; merchant and transaction records exportable. |
| 5 | Auditability | Every privileged action, funds-flow decision and compliance approval has actor, time, reason and evidence. |
Merchants/exporters; cardholders; acquiring banks and processors; FAC; Visa and Mastercard; CBTT; authorised-dealer banks; FIUTT and tax authorities where relevant; engineering, operations, compliance, legal counsel and OPRL contributors.
Legal, contractual, technical and organisational boundaries · Official arc42 guidance ↗
CBTT's published list, dated as at 1 August 2026, includes registered PSPs such as Bill Express, PayWise, WiPay, Convenience Pay and VIA; it separately lists e-money issuers including PayWise, PESH, TSTT PAYPR, WIDiT and WAM. It lists Infolink as an interbank payment-system operator and states that no Non-Interbank Payment System Operators (NIPSOs) were registered at that date. These categories are not interchangeable: PSP registration does not itself prove a provider has card-scheme acquiring sponsorship, can onboard sub-merchants, or can settle foreign-currency export proceeds. The register is evidence of existing regulated payment businesses, not proof of an open acquiring market.
CBTT approved PSP/EMI/PSO register ↗
Legal status note: the CBTT November 2026 Financial Stability Report describes the Payment Systems and Services Bill and three supporting regulations as draft instruments consulted on in 2026. Re-check Gazette enactment and commencement before relying on them.
Systems, actors, interfaces and explicit exclusions · Official arc42 guidance ↗
| External party | Interface | Contractual/technical dependency |
|---|---|---|
| Merchant systems | REST API, hosted checkout, signed webhooks | Merchant credentials, permitted domains, order references |
| FAC / sponsor acquirer | Provider adapter API, 3DS handoff, reports | Signed agreement, sandbox, certification, settlement schedule |
| Visa / Mastercard | Indirect via acquirer and registered service-provider roles | Scheme rules, registration and sponsor classification |
| Merchant bank | Settlement account and bank statements | Account eligibility, currency and payout permissions |
| CBTT / other authorities | Applications, supervisory reporting, legal determinations | Regulatory perimeter and current law |
Decisions that shape the implementation · Official arc42 guidance ↗
First commercial dependency: written sponsor/processor term sheet + sandbox access + confirmation of T&T merchant eligibility + exact funds-flow and settlement schedule.
Component decomposition, interfaces, data ownership and APIs · Official arc42 guidance ↗
| Module | Owns | Does not own |
|---|---|---|
| Merchant | Merchant profile, status, pricing plan, acquirer merchant IDs | Bank KYC decision; funds |
| Payment API | PaymentIntent lifecycle and API contract | Card network authorisation logic |
| Orchestrator | Provider selection, retry policy, timeout resolution | Unilateral failover on ambiguous authorisation |
| Provider adapter | Translate internal commands/events to provider contract | Shared business state machine |
| Ledger | Immutable double-entry journal and balance views | Custody or bank balance |
| Reconciliation | Match provider settlement reports to captures/refunds/fees | Initiating bank settlement |
| Webhook service | Signed, retryable merchant event delivery | Guaranteeing merchant endpoint availability |
POST /v1/payment-intents
GET /v1/payment-intents/{id}
POST /v1/payment-intents/{id}/confirm
POST /v1/payment-intents/{id}/capture
POST /v1/payment-intents/{id}/cancel
POST /v1/refunds
GET /v1/refunds/{id}
GET /v1/transactions
GET /v1/settlements
GET /v1/disputes
POST /v1/webhook-endpoints
Required headers:
Authorization: Bearer <merchant_api_key>
Idempotency-Key: <unique-per-business-operation>
API-Version: 2026-01-01 (example; freeze before launch)All amounts are integer minor units with ISO 4217 currency code. Never use floating-point arithmetic for money. Every request is scoped to merchant_id and authorised at object level.
requires_payment_method
→ requires_confirmation
→ requires_action (3DS)
→ processing
→ requires_capture (if manual capture)
→ succeeded
Alternative terminal/exception states:
failed · canceled · partially_refunded · refunded
Dispute is a separate lifecycle linked to the captured payment.
Settlement is a separate reconciliation lifecycle; do not equate succeeded with settled.Keep PAN/CVV out of this schema entirely. Store only provider tokens and non-sensitive card metadata explicitly permitted by the provider and PCI assessor.
Payment, 3DS, webhook, refund and settlement scenarios · Official arc42 guidance ↗
Mark attempt unknown / pending_provider_resolution; query provider by merchant reference/idempotency key before retrying. Never automatically send the same financial instruction to a second acquirer when the first acquirer's result is ambiguous. Duplicate capture risk must be resolved explicitly.
Refund creates a new linked financial event; it does not erase the capture. Partial refunds are cumulative and cannot exceed refundable captured amount. Chargeback has its own deadlines, evidence checklist, owner and outcome events.
Runtime topology, environments, network boundaries and operations · Official arc42 guidance ↗
Cloudflare can front the merchant API and serve the public/dashboard UI. Run the financial core as a conventional containerised service on a managed compute platform with managed PostgreSQL and durable queue. The exact cloud vendor is a procurement decision; do not bind the ledger to Cloudflare D1. Use object storage for settlement files and audit exports, with encryption and retention policies.
Cloudflare Pages + Workers + D1 + private R2 + Turnstile + Access for internal admin. Durable Objects only if live collaboration/presence is needed. Identity-document objects are isolated from contribution evidence; upload URLs are short-lived; every access is audited. This platform is not in the payment transaction path.
Security, money, privacy, integration and operational patterns · Official arc42 guidance ↗
Integrate through the acquirer/3DS Server/SDK arrangement. Do not implement EMV 3DS protocol cryptography or issuer challenge handling from scratch. Support frictionless and challenge outcomes, browser return, asynchronous result notification and authentication data in the provider's expected authorisation request.
KYB and underwriting decision owned by contracted party as defined in agreement. Platform can collect evidence and run workflow but cannot imply that its own checklist replaces the acquirer's underwriting, sanctions screening, AML/CFT or ongoing monitoring.
Accept national ID or passport. Administrators verify identity; credential issuers/employers verify credentials where feasible; specialist reviewers assess contributions. Public identity is contributor choice. Open contributors can submit before verification. Store raw documents privately, segregate identity records, minimise retention and audit access.
Decision records with rationale, status and consequences · Official arc42 guidance ↗
| ID | Decision | Status | Reason / consequence |
|---|---|---|---|
| ADR-001 | Non-custodial gateway/payment-facilitation candidate, sponsor acquirer settles directly to merchant | Conditional | Fastest lawful path; subject to CBTT classification, acquirer contract and scheme rules. |
| ADR-002 | First local route investigated: First Citizens + FAC hosted gateway | Investigate | Public product proves TTD e-commerce route exists; independent white-label/API commercial arrangement not yet evidenced. |
| ADR-003 | Hosted redirect payment page for v1 | Recommended | Minimises card-data exposure; acquirer/QSA determines PCI validation. |
| ADR-004 | PostgreSQL ledger and transactional outbox | Recommended | Strong transaction integrity, auditability and durable event delivery. |
| ADR-005 | Modular monolith before microservices | Recommended | Reduces distributed-systems complexity until volume/team boundaries justify splitting. |
| ADR-006 | Provider-neutral adapter contract | Required | Prevents lock-in; adapter implementation waits for real API specs. |
| ADR-007 | OPRL research platform separate from gateway | Required | Different security, privacy and availability profiles; no identity docs or payment data shared by default. |
| ADR-008 | Do not create own card vault or network | Required | Use validated provider tokenisation and card schemes/acquirer infrastructure. |
Measurable quality scenarios and acceptance criteria · Official arc42 guidance ↗
| Quality scenario | Target / test | Release gate |
|---|---|---|
| Duplicate create/capture request | Same idempotency key returns same result; no duplicate financial action | Automated concurrency test |
| Provider timeout after submit | Attempt marked unknown; query-before-retry; no blind second-acquirer failover | Fault-injection test |
| Provider sends duplicate webhook | One state transition; duplicates acknowledged safely | Replay test |
| Settlement file has unmatched line | Exception raised; no silent adjustment; maker-checker resolution | Reconciliation UAT |
| Merchant requests another tenant's payment | 403/404 with no data leakage | BOLA security test |
| Cardholder checkout | Raw PAN/CVV never traverses gateway servers | Network capture + code review |
| Database recovery | Restore from encrypted backup to documented RPO/RTO | Quarterly restore exercise |
| Webhook endpoint unavailable | Bounded exponential retry, delivery status visible, manual replay controlled | Chaos test |
| Merchant payout | Expected net settlement reconciles to captured sales less refunds, fees, reserves and adjustments | Daily financial control |
These are design targets, not current performance claims or commitments. Upstream authorisation time and bank settlement timing are contract-controlled.
Known unknowns, external dependencies and mitigations · Official arc42 guidance ↗
| Risk / unknown | Impact | Mitigation / evidence needed |
|---|---|---|
| No acquirer contract / sandbox | Gateway cannot process live transactions | Do not build proprietary adapter until contract, API docs and credentials exist. |
| CBTT classification unclear | Unlawful operation / delayed launch | Submit funds-flow diagram, contracts and activity matrix for written classification. |
| FX settlement route unavailable | Exporters cannot access/retain expected proceeds | Get written authorised-dealer opinion for each currency/account/flow; separate export receipts from domestic FX demand. |
| Single acquirer concentration | Service outage or commercial lock-in | Second adapter and portability after first certified integration. |
| Chargeback/fraud losses | Merchant or platform insolvency | Define liability, reserves, fraud tooling, MCC restrictions and escalation contractually. |
| PCI scope misunderstood | Costly remediation / security breach | Hosted redirect; formal scope review with QSA/acquirer before design freeze. |
| Provider API differs from assumptions | Rework | Contract-first adapter implementation; contract tests using provider sandbox. |
| OPRL identity-document breach | Severe privacy harm | Separate R2 bucket/account, short-lived URLs, encryption, audit, least privilege, retention and incident plan. |
| CAPSS mistaken for acquiring | Wrong architecture investment | Obtain scheme rules, access model, merchant use-case and commercial terms before integration. |
No temporary bypasses in money-state transitions, no floating-point amounts, no mutable ledger history, no shared production credentials, no manual database edits to repair payment state. Every exception is an audited compensating transaction.
Ordered work packages; each phase has a testable exit condition.
Known public products are separated from unverified partnership assumptions.
First Citizens' public e-commerce page says its service uses an FAC gateway, a hosted payment page, 3-D Secure and TTD settlement; it requires a First Citizens account for collection. Its published application requirements include business plan/projections, company documents, director/secretary IDs, refund policy and fraud controls. This proves a live local e-commerce product exists. It does not prove that First Citizens or FAC will offer an independent platform a master merchant/facilitator contract or an API/white-label model.
First Citizens e-Commerce product page ↗
Republic Bank, RBC, Scotiabank and CIBC Caribbean: request the same technical and commercial schedules. Do not assume their products or API arrangements are equivalent. Ask each to identify the legal acquirer, processor, card-scheme sponsor, sub-merchant model and settlement bank.
Visa describes third-party agents including gateways, processors and service providers; most require a Visa client sponsor, and Visa asks for sponsor, category, service description and PCI documents. Mastercard defines a payment facilitator as a service provider registered by an acquirer to facilitate transactions for sub-merchants. The sponsor bank must determine the correct classification and initiate the required registrations. Do not infer scheme approval from CBTT PSP registration.
Visa Third Party Agent registration ↗ · Mastercard Payment Facilitator rules overview ↗
CBTT currently states PSPs are registered under Central Bank Act s.36(cc) and Payment Systems Guideline No.3. The application must reflect actual functions and funds flows. Gateway-only technical service, merchant facilitation, remittance, e-money and payment-system operation must not be conflated. Ask CBTT which categories apply before accepting live funds flows.
CBTT PSP registration page ↗ · CBTT payment-system landscape ↗
Preserved and sharpened from the prior engineering/research handoff.
| Reform | Lead | First deliverable | Legal / institutional lever |
|---|---|---|---|
| Digital export earnings permission | CBTT + Ministry of Finance + authorised dealers | Current-law opinion; transaction-specific funds-flow map; published permission/exemption/direction or Act amendment if needed | Exchange Control Act Chap.79:50 ss.2,3,5,6; subsidiary instruments and directions. Current consolidation must be updated. |
| Activity-based payment-service categories | CBTT + Ministry / Parliament | Clause-by-clause gap table and revised text; distinguish technical gateway, initiation, merchant facilitation, acquiring, remittance, e-money and system operator | Central Bank Act s.36(cc); PSP Guideline No.3; draft Payment Systems and Services Bill and three regulations; verify Gazette status. |
| CBTT classification service | CBTT | Standard funds-flow submission form, decision tree, complete-file checklist and proposed 10-business-day preliminary classification target | Administrative procedure / PSP registration framework. Proposed target, not existing deadline. |
| Business KYB interoperability | Companies Registry + CBTT + banks | Consent-based CROS verification API, reusable KYB pack, status tracking and rejection reason codes | Companies legislation, banking supervision, AML/CFT and data-protection rules. |
| CROS fast track | Companies Registry / Ministry responsible for legal affairs | Digital credentials, e-signatures, status tracking and published processing targets | Companies legislation, registry rules and digital-government policy. |
| FX allocation transparency | CBTT + Finance + authorised dealers | Quarterly anonymised data by sector/dealer, queue times, unmet demand, allocation methodology and exemptions | CBTT reporting powers, dealer reporting and Ministry policy. |
| Merchant settlement disclosures | CBTT + regulated providers | Standard pre-contract disclosure: currencies, value dates, fees, FX spread, reserves, refunds, chargebacks, freezes and complaints | PSP/acquirer supervisory rules and licence conditions. |
| CAPSS merchant access | CBTT + CARICOM + participants | Merchant use-case/access study: merchant eligibility, PSP access, FX, fees, finality, reversals, disputes, API and launch path | Regional system rules and participating central-bank arrangements. |
| Competition / portability | CBTT + competition authorities + banks/PSPs | Evidence-based review of exclusivity, tying, access criteria, API interoperability, portability and termination | Payment services and competition framework; do not allege exclusion without contract evidence. |
Domestic TTD purchase routed through a foreign processor and overseas customer paying a T&T exporter are not the same underlying transaction. The National E-Commerce Strategy identifies domestic card transactions routed through international PSPs being treated as international transactions in some cases. Export receipt, offshore collection, local FX-account credit, retention, conversion and repatriation each require separate legal and bank analysis.
CBTT's November 2026 report says CAPSS testing for instant cross-border payments without intermediaries was successful. That does not establish merchant acquiring, merchant/PSP access, card-not-present support or merchant dispute functionality. Assess its actual operating rules before designing an adapter.
Questions that cannot be answered from public marketing pages alone.
| Evidence gap | Who holds it | Exact request | Decision unlocked |
|---|---|---|---|
| Acquirer commercial model | First Citizens, Republic, RBC, Scotiabank, CIBC Caribbean | Current merchant agreement, facilitator/agent agreement, fees, reserves, MCC matrix, onboarding criteria, settlement terms, termination clauses | Can we operate an independent gateway/payment facilitator? |
| FAC technical integration | FAC | API docs, sandbox, tokenisation/3DS, settlement files, webhooks, certification, white-label terms, multi-acquirer support | Which adapter and integration pattern to build? |
| Scheme category | Sponsor acquirer, Visa, Mastercard | Written TPA / payment-facilitator classification, registration steps, sponsor responsibilities, PCI evidence | Which scheme registrations are mandatory? |
| Regulatory perimeter | CBTT and local payments counsel | Funds-flow diagram, contracts, customer journey, role matrix and written classification | Which local registration/licence applies? |
| Export FX permissions | Authorised-dealer FX teams, CBTT, Ministry of Finance, counsel | Written rule/section/direction for foreign acquirer payout, offshore balance, local USD account, retention, conversion and expenses | Can exporter receive and use the agreed currency? |
| Current legislation | CBTT, Ministry, Parliament, Gazette | Final Bill, all regulations, consultation submissions/response matrix, amendments, Gazette and commencement | Which framework is actually in force? |
| CAPSS design | CBTT / CARICOM | Rulebook, participants, message/API specs, FX, settlement finality, access and use cases | Is merchant payment integration technically and legally possible? |
| Merchant demand economics | Exporters and merchants | Monthly volume, average ticket, card mix, MCC, failed-provider cases, FX needs, acceptable pricing | Is first acquirer route commercially sustainable? |
The CBTT register confirms local PSP activity and identifies the legal registration categories. It does not publish each provider's acquiring bank, Visa/Mastercard registration, sub-merchant underwriting model, international-card acceptance scope, FX settlement permissions or API access. Those must be established from contracts and provider documentation. Do not treat a PSP list as an acquiring directory.
Re-check live status and current editions before legal or certification reliance.