pedropardoso / startup-kit-payments
Startup Kit — Payments module: payment processing with multi-gateway support
Package info
github.com/PedroPCardoso/startup-kit-payments
pkg:composer/pedropardoso/startup-kit-payments
Requires
- php: ^8.4
- illuminate/contracts: ^12.0
- illuminate/support: ^12.0
- pedropardoso/startup-kit-core: ^1.0
Requires (Dev)
- mercadopago/dx-php: ^3.0
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^11.0
- stripe/stripe-php: ^16.0
Suggests
- mercadopago/dx-php: Required to use the Mercado Pago payment gateway (~3.0)
- stripe/stripe-php: Required to use the Stripe payment gateway (~16.0)
This package is not auto-updated.
Last update: 2026-08-18 14:28:32 UTC
README
Payment processing domain module with multi-gateway support.
Part of Startup Kit, a modular backend for SaaS products built on PHP 8.4 / Laravel 12 with DDD, CQRS and ports & adapters.
Architecture
src/Payments
├── Domain # Payment aggregate, PaymentId, PaymentStatus, PaymentCaptured event
├── Application # CapturePayment command, GetPaymentById / ListPayments queries + handlers
├── Contracts # PaymentGateway and PaymentRepository ports
├── Http # Controller, FormRequest, API Resource
└── Infrastructure # Persistence adapters: Eloquent, Postgres, MySQL, Mongo, InMemory
Highlights
- Gateway-agnostic — the
PaymentGatewayport keeps the domain independent of providers; Stripe and Mercado Pago SDKs are suggested integrations - CQRS — commands and queries dispatched through the core buses (logging, tracing and transactions come for free)
- Domain events —
PaymentCapturedpublished via the core event bus with transactional outbox - Swappable persistence — Postgres, MySQL, Mongo, Eloquent or in-memory, selected by config
Install
composer require pedropardoso/startup-kit-payments
Not yet on Packagist — add the repo as a VCS repository in your
composer.jsonfirst:{ "repositories": [{ "type": "vcs", "url": "https://github.com/PedroPCardoso/startup-kit-payments" }] }
Requires startup-kit-core. The service provider is auto-discovered by Laravel; configuration lives in config/startup-kit-payments.php and migrations ship with the package.
Testing
composer install vendor/bin/phpunit
Unit and integration tests run on Orchestra Testbench. Repository adapters share a contract test case, so every persistence backend is verified against the same behaviour.
Startup Kit modules
| Module | Description |
|---|---|
| startup-kit-core | Primitives, contracts and cross-cutting infrastructure |
| startup-kit-users | User registration & management |
| startup-kit-payments | Payments with multi-gateway support (Stripe, Mercado Pago) |
| startup-kit-orders | Orders & order lines |
| startup-kit-subscriptions | Recurring subscriptions |
| startup-kit-notifications | Multi-channel notifications (SendGrid, Twilio, Telegram) |
License
MIT