Payment Infrastructure
Live System

Accorn Payment Microservice

Rather than embedding Stripe logic in every platform, we extracted payment processing into two dedicated Lumen microservices: accorn-payment (primary) and payment-acorn-vet (vet-specific wrapper). Lumen is Laravel's micro-framework — no Blade, no sessions, just fast REST endpoints. Each service handles charge creation, refund processing, and Stripe webhook verification. API key middleware authenticates incoming requests from other services. Transaction records are stored in MySQL for audit trails. This architecture means a payment bug gets fixed in one place and every platform benefits immediately.

The Result

A single source of truth for payment processing across the TecSolPro ecosystem, reducing duplication and making payment logic easier to audit and maintain.

Build Something Similar
Ac

Tech Stack

Lumen 10PHP 8.1Stripe PHP SDKMySQLGuzzleJWT

4

Modules

6

Technologies

5

Highlights

Project Ecosystem

Applications in This Project.

This project is built as 2 interconnected applications, each with a distinct responsibility.

App 01

accorn-payment

Lumen 10

Primary Acorn payment microservice

App 02

payment-acorn-vet

Lumen 10

Vet-specific payment wrapper

Key Features

What It Does.

Isolated payment logic consumed by all TecSolPro platforms

Stripe webhook verification with signature validation

API key middleware for inter-service authentication

Technology Stack

How It's Built.

Backend / API

Lumen 10PHP 8.1Stripe PHP SDKGuzzleJWT

Database & Cache

MySQL
Platform Modules

Under the Hood.

Every module shipped in Accorn Payment Microservice — what it does and the features it covers.

Module 01

Payment Controller

Create charges and handle 3D Secure flows via Stripe's PaymentIntent API.

What's Included

  • PaymentIntent creation
  • 3D Secure support
  • Payment confirmation handling
  • Transaction record storage (MySQL)
  • API key authentication via middleware
Module 02

Refund Controller

Process full and partial refunds with MySQL transaction updates and event reconciliation.

What's Included

  • Full refund processing
  • Partial refund support
  • Transaction record updates
  • Webhook event reconciliation
  • Audit trail logging
Module 03

Webhook Handler

Stripe-Signature verified webhook endpoint that triggers downstream platform events.

What's Included

  • Stripe-Signature header validation
  • Payment intent succeeded/failed handling
  • Downstream event dispatch
  • Secure endpoint with signature check
Module 04

Middleware Layer

ApiKeyMiddleware authenticates every inter-service request. JWT Authenticate middleware for user tokens.

What's Included

  • ApiKeyMiddleware.php for service auth
  • Authenticate.php for user JWT
  • Lumen zero-overhead routing
  • Single responsibility per controller
Technical Highlights

The Interesting Parts.

Key architectural decisions, patterns, and technical details worth knowing.

01

Lumen micro-framework: no Blade, no sessions, no middleware bloat — just fast REST endpoints

02

Stripe webhook signature validation using Stripe-Signature header prevents forged payment events

03

ApiKeyMiddleware authenticates every inter-service request from other TecSolPro platforms

04

Separate PaymentController, RefundController, and WebhookController — single responsibility per class

05

All transactions written to MySQL for full audit trail and reconciliation reporting

Data Models

Core Models & Tables.

The primary database models that power Accorn Payment Microservice.

Payment

Stripe payment transaction record

Refund

Refund transaction record

WebhookLog

Incoming webhook event log

Battle-Tested in Production

Want Something Like This?

We've built systems like this before — we know the pitfalls, the patterns that work, and how to scope it correctly from day one.