PHPackages                             flowcoders/maestro - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. flowcoders/maestro

ActiveLibrary[Payment Processing](/categories/payments)

flowcoders/maestro
==================

Unified payment gateway for Laravel - Write once, use with any payment provider (MercadoPago, Stripe, and more)

v0.1.0(10mo ago)11MITPHPPHP ^8.3CI passing

Since Aug 22Pushed 9mo agoCompare

[ Source](https://github.com/flowcoders/maestro)[ Packagist](https://packagist.org/packages/flowcoders/maestro)[ Docs](https://github.com/flowcoders/maestro)[ GitHub Sponsors](https://github.com/flowcoders)[ RSS](/packages/flowcoders-maestro/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (12)Versions (3)Used By (0)

Maestro - Unified Payment Gateway for Laravel
=============================================

[](#maestro---unified-payment-gateway-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2dc960650248bdff3a5d8a7b71e0511ec04157a600969cbf723b6a245a1ebf53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c6f77636f646572732f6d61657374726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/flowcoders/maestro)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8ab9f376a9611c3d62d36d516da5f580450f01805575da23ee73ba870a6c8c0b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f666c6f77636f646572732f6d61657374726f2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/flowcoders/maestro/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/eea0b197bfa62b24fd5ffab86173e8077673a312c3463fc9a9385b1ea7ab362e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f666c6f77636f646572732f6d61657374726f2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/flowcoders/maestro/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/22d9ba9e7428bcb7120008cf0028785846d598a355e7c57f59269789d5a55fb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c6f77636f646572732f6d61657374726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/flowcoders/maestro)

**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?
------------

[](#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
---------------

[](#whats-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
------------

[](#installation)

```
composer require flowcoders/maestro
```

Quick Setup
-----------

[](#quick-setup)

1. **Add your credentials to `.env`**:

```
MERCADOPAGO_ACCESS_TOKEN=TEST-your_token_here
```

2. **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
--------------

[](#usage-examples)

### Create a Payment

[](#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

[](#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
----------------

[](#-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?
-------------------

[](#need-more-examples)

Check out [`examples/basic-usage.php`](examples/basic-usage.php) for a complete working example with all features.

Contributing
------------

[](#contributing)

Contributions are welcome! Please see our [contributing guide](CONTRIBUTING.md).

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

For security vulnerabilities, please email the maintainer directly instead of using the issue tracker.

Credits
-------

[](#credits)

- **[Paulo Guerra](https://github.com/pvguerra)** - Creator &amp; maintainer

License
-------

[](#license)

MIT License. See [LICENSE.md](LICENSE.md) for details.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance55

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

315d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf5f7308b206002e8dbc2fc2d0551bf0ba1a76b2add7acac9226dc8f62bb99a2?d=identicon)[pvguerra](/maintainers/pvguerra)

---

Top Contributors

[![pvguerra](https://avatars.githubusercontent.com/u/17501080?v=4)](https://github.com/pvguerra "pvguerra (40 commits)")[![Humble23](https://avatars.githubusercontent.com/u/31668778?v=4)](https://github.com/Humble23 "Humble23 (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelstripepaymentgatewaymercadopagopayment gatewaypixAsaasPayment Providerunified-api

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/flowcoders-maestro/health.svg)

```
[![Health](https://phpackages.com/badges/flowcoders-maestro/health.svg)](https://phpackages.com/packages/flowcoders-maestro)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24857.5k](/packages/vormkracht10-laravel-mails)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

8120.4k](/packages/danestves-laravel-polar)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

882.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
