flowcoders/maestro
Composer 安装命令:
composer require flowcoders/maestro
包简介
Unified payment gateway for Laravel - Write once, use with any payment provider (MercadoPago, Stripe, and more)
关键字:
README 文档
README
Stop rewriting payment code every time you switch payment providers.
Maestro provides a single, consistent API for all your payment needs. Whether you're using MercadoPago today and want to add Stripe tomorrow, or need to switch providers entirely - your code stays the same.
Why Maestro?
The Problem: Every payment provider has different APIs, data formats, and integration patterns. Switching providers means rewriting all your payment logic.
The Solution: Write your payment code once, use it with any provider.
// This same code works with MercadoPago, Stripe, or any other provider $money = new Money(10000, Currency::BRL); // R$ 100.00 in cents $pix = new Pix(expiresAt: 60); // 1 hour expiration $payment = Maestro::createPayment(new PaymentRequest( money: $money, paymentMethod: $pix, description: 'Product purchase', customer: new Customer(/* ... */), ));
What's Included
- ✅ MercadoPago - Full support including PIX
- 🔄 More providers coming - Stripe, Adyen, PagSeguro
- 🛡️ Type-safe - Full PHP 8.3+ type declarations
- 🧪 Battle-tested - Comprehensive test coverage
Installation
composer require flowcoders/maestro
Quick Setup
- Add your credentials to
.env:
MERCADOPAGO_ACCESS_TOKEN=TEST-your_token_here
- Start processing payments:
use Flowcoders\Maestro\Facades\Maestro; use Flowcoders\Maestro\ValueObjects\Money; use Flowcoders\Maestro\ValueObjects\PaymentMethod\Pix; $payment = Maestro::createPayment(/* ... */);
That's it! No config files, no complex setup.
Usage Examples
Create a Payment
use Flowcoders\Maestro\Facades\Maestro; use Flowcoders\Maestro\DTOs\PaymentRequest; use Flowcoders\Maestro\DTOs\Customer; use Flowcoders\Maestro\ValueObjects\Money; use Flowcoders\Maestro\ValueObjects\Email; use Flowcoders\Maestro\ValueObjects\PaymentMethod\Pix; use Flowcoders\Maestro\Enums\Currency; // Create payment components $money = new Money(10000, Currency::BRL); // R$ 100.00 in cents $pix = new Pix(expiresAt: 60); // Expires in 1 hour $customer = new Customer( firstName: 'John', lastName: 'Doe', email: new Email('customer@example.com') ); // Create the payment $payment = Maestro::createPayment(new PaymentRequest( money: $money, paymentMethod: $pix, description: 'Product purchase', customer: $customer )); // Get payment details echo $payment->id; // Payment ID from provider echo $payment->status->value; // 'pending', 'approved', etc.
All Operations
// Create payment $payment = Maestro::createPayment($paymentRequest); // Get payment status $payment = Maestro::getPayment('payment_id'); // Cancel payment $payment = Maestro::cancelPayment('payment_id'); // Refund payment (full or partial) $refundMoney = new Money(5000, Currency::BRL); // Partial refund $payment = Maestro::refundPayment(new RefundRequest( paymentId: 'payment_id', money: $refundMoney, // Optional: leave null for full refund reason: 'Customer request' ));
💰 Money Handling
Use the Money value object with amounts in cents:
// ✅ Correct $money = new Money(10000, Currency::BRL); // R$ 100.00 // ❌ Wrong amount: 100.00 // This field doesn't exist
Maestro automatically converts to each provider's expected format.
Need More Examples?
Check out examples/basic-usage.php for a complete working example with all features.
Contributing
Contributions are welcome! Please see our contributing guide.
Testing
composer test
Security
For security vulnerabilities, please email the maintainer directly instead of using the issue tracker.
Credits
- Paulo Guerra - Creator & maintainer
License
MIT License. See LICENSE.md for details.
flowcoders/maestro 适用场景与选型建议
flowcoders/maestro 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 08 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「gateway」 「stripe」 「laravel」 「mercadopago」 「Asaas」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 flowcoders/maestro 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 flowcoders/maestro 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 flowcoders/maestro 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Flexible payment integration for Laravel, lunarphp, supporting multiple payment providers.
Rich payment solutions for Laravel framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-28