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.
Tech Stack
4
Modules
6
Technologies
5
Highlights
Applications in This Project.
This project is built as 2 interconnected applications, each with a distinct responsibility.
accorn-payment
Lumen 10Primary Acorn payment microservice
payment-acorn-vet
Lumen 10Vet-specific payment wrapper
What It Does.
Isolated payment logic consumed by all TecSolPro platforms
Stripe webhook verification with signature validation
API key middleware for inter-service authentication
How It's Built.
Backend / API
Database & Cache
Under the Hood.
Every module shipped in Accorn Payment Microservice — what it does and the features it covers.
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
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
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
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
The Interesting Parts.
Key architectural decisions, patterns, and technical details worth knowing.
Lumen micro-framework: no Blade, no sessions, no middleware bloat — just fast REST endpoints
Stripe webhook signature validation using Stripe-Signature header prevents forged payment events
ApiKeyMiddleware authenticates every inter-service request from other TecSolPro platforms
Separate PaymentController, RefundController, and WebhookController — single responsibility per class
All transactions written to MySQL for full audit trail and reconciliation reporting
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
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.