Skip to content

Merchant Gateway Architecture & API Design #303

@kelly-musk

Description

@kelly-musk

📋 Description

This issue involves designing the "Entry Point" for commercial adoption. The Merchant Gateway is a specialized layer of the Aframp platform that allows businesses to generate invoices, process payments in cNGN, and manage their digital storefronts. Unlike a standard peer-to-peer wallet, the Merchant Gateway must handle high-concurrency transaction volumes, provide instant "Payment Confirmed" webhooks, and support complex metadata (like Order IDs and SKU details) required for business accounting.

🎯 Objective

Create a robust, developer-friendly infrastructure that allows any business to integrate cNGN payments into their existing checkout flow with minimal technical overhead.

🛠️ Technical Requirements

  • Merchant Scoped API Keys:
    • Implement a secure "Public/Private Key" pair system for merchants to authenticate their backend servers.
    • Support for "Restricted Scopes" (e.g., a key that can only "Read" transactions but not "Refund").
  • Unified Checkout Object:
    • Define the Invoice schema: amount_cngn, callback_url, expiry_time (e.g., 15 minutes), and merchant_reference.
  • High-Speed Webhook Engine:
    • A reliable notification service that sends a POST request to the merchant's server the moment the Stellar Network confirms a payment.
    • Implement "Exponential Backoff" retries for failed webhook deliveries.
  • Idempotency Logic:
    • Ensure that a single "Order ID" cannot be paid twice, preventing duplicate charges for the same customer purchase.

✅ Acceptance Criteria

  • Merchants can generate a unique payment_intent_id via a REST API.
  • The system monitors the blockchain and transitions the invoice state from PENDING to PAID in under 5 seconds.
  • Webhooks are cryptographically signed to allow merchants to verify they originated from Aframp.
  • The architecture supports "Meta-Transactions" where the merchant can choose to pay the network gas fees (Stellar XLM) for their customers.

🔴 Priority: Critical

Labels: Merchant-Tools, API-Design, Ecosystem


Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions