PHPackages                             mobly/boleto-flex - 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. mobly/boleto-flex

ActiveLibrary[Payment Processing](/categories/payments)

mobly/boleto-flex
=================

Boletoflex SDK Integration

23.3kPHPCI failing

Since Sep 26Pushed 6y ago12 watchersCompare

[ Source](https://github.com/mobly/boleto-flex)[ Packagist](https://packagist.org/packages/mobly/boleto-flex)[ RSS](/packages/mobly-boleto-flex/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (5)Used By (0)

 [![](https://camo.githubusercontent.com/39c481f743081ecd74382f9ae1cf227c4c613a82af6959edf637c060e63c3faa/68747470733a2f2f7777772e6d6f626c792e636f6d2e62722f696d616765732f6d6f626c79342f6c6f676f2d6d6f626c79342e737667)](https://camo.githubusercontent.com/39c481f743081ecd74382f9ae1cf227c4c613a82af6959edf637c060e63c3faa/68747470733a2f2f7777772e6d6f626c792e636f6d2e62722f696d616765732f6d6f626c79342f6c6f676f2d6d6f626c79342e737667)

[![](https://github.com/mobly/boleto-flex/workflows/PHP%20Default%20Workflow/badge.svg)](https://github.com/mobly/boleto-flex/workflows/PHP%20Default%20Workflow/badge.svg)

Mobly BoletoFlex-SDK
====================

[](#mobly-boletoflex-sdk)

Simple SDK to make an standardize boleto flex partner integration

How to use
----------

[](#how-to-use)

Make a Payment Transaction:

```
require __DIR__ . '/vendor/autoload.php';

use Mobly\Boletoflex\Sdk\Client;
use Mobly\Boletoflex\Sdk\Entities\Buyer;
use Mobly\Boletoflex\Sdk\Entities\Shipping;
use Mobly\Boletoflex\Sdk\Entities\Address;
use Mobly\Boletoflex\Sdk\Entities\Payment;
use Mobly\Boletoflex\Sdk\Transactions\Transaction;
use Mobly\Boletoflex\Sdk\Entities\Seller;
use Mobly\Boletoflex\Sdk\Entities\Cart;
use Mobly\Boletoflex\Sdk\Entities\CartItem;
use Mobly\Boletoflex\Sdk\Entities\History;
use Mobly\Boletoflex\Sdk\Entities\HistoryItem;

$client = new Client();

$buyer = new Buyer();
$buyer->setPhoneNumber('11987654321');
$buyer->setName('Joaquim Levy');
$buyer->setCpf('46883731806');
$buyer->setEmail('joaquim@gmail.com');

$seller = new Seller();
$seller->setName('Mobly');

$address = new Address();
$address->setZip('88034480');
$address->setNumber('156');
$address->setCountry('BR');
$address->setCity('Florianópolis');
$address->setStreet('Rua Itapiranga');
$address->setDistrict('Itacorubi');
$address->setState('SC');
$address->setComplement('Bloco A Ap. 604');

$shipping = new Shipping();
$shipping->setAmount(35.00);
$shipping->setAddress($address);

$service = new Service();
$service->setDescription('Montagem');
$service->setAmount(150.00);

$payment = new Payment();
$payment->setAmount(1174.98);
$payment->setDiscount(50.00);
$payment->setCart(1189.98);
$payment->addService($service);

$cartItem = new CartItem();
$cartItem->setAmount(289.99);
$cartItem->setQuantity(1);
$cartItem->setDescription('Conjunto com 2 Cadeiras Eames Eiffel Preto Base Madeira');
$cartItem->setWeight(7.6);
$cartItem->setSku('201558');
$cartItem->setCategory('Móveis - Cadeiras de Jantar');

$cart = new Cart();
$cart->addItem($cartItem);

$historyPayment = new Payment();
$historyPayment->setAmount(1334.90);

$historyAddressShipping = new Address();
$historyAddressShipping->setZip('88034480');

$historyShipping = new Shipping();
$historyShipping->setAmount(5.00);
$historyShipping->setAddress($historyAddressShipping);

$historyCartItem = new CartItem();
$historyCartItem->setAmount(1329.90);
$historyCartItem->setQuantity(1);
$historyCartItem->setDescription('Conjunto Retrô Sidari para Banheiro com Cuba Acabamento Vermelho e Rafia');
$historyCartItem->setSku('345253');
$historyCartItem->setCategory('Móveis - Armários de Banheiro');

$historyCart = new Cart();
$historyCart->addItem($historyCartItem);

$historyItem = new HistoryItem();
$historyItem->setDate('2018-06-21T18:34:00.000Z');
$historyItem->setReference('00003354');
$historyItem->setPayment($historyPayment);
$historyItem->setShipping($historyShipping);
$historyItem->setCart($historyCart);

$history = new History();
$history->addItem($historyItem);

$transaction = new Transaction();
$transaction->setReference('00004122');
$transaction->setCurrency('BRL');
$transaction->setSeller($seller);
$transaction->setCart($cart);
$transaction->setHistory($history);
$transaction->setShipping($shipping);
$transaction->setBuyer($buyer);
$transaction->setPayment($payment);

try {
    $response = $client->transaction($transaction);
    echo $response->getStatusCode();
    echo $response->getBody();
    exit;
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    die($e->getMessage());
}
```

---

Pre approval transaction:

```
require __DIR__ . '/vendor/autoload.php';

use Mobly\Boletoflex\Sdk\Transactions\PreApproval;
use Mobly\Boletoflex\Sdk\Entities\Buyer;
use Mobly\Boletoflex\Sdk\Entities\Shipping;
use Mobly\Boletoflex\Sdk\Entities\Address;
use Mobly\Boletoflex\Sdk\Entities\Payment;

$preApprovalTransaction = new PreApproval();

$buyer = new Buyer();
$buyer->setCpf('21846764890');

$address = new Address();
$address->setCity('Florianópolis');
$address->setState('SC');
$address->setZip('88034480');

$shipping = new Shipping();
$shipping->setAddress($address);

$payment = new Payment();
$payment->setAmount(1500.00);

$preApprovalTransaction->setBuyer($buyer);
$preApprovalTransaction->setShipping($shipping);
$preApprovalTransaction->setPayment($payment);

try {
    $response = $client->preApproval($preApprovalTransaction);
    echo $response->getStatusCode();
    echo $response->getBody();
    exit;

} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    die($e->getMessage());
}
```

---

Verify status:

```
require __DIR__ . '/vendor/autoload.php';

use Mobly\Boletoflex\Sdk\Transactions\VerifyFundingStatus;

$verifyFundingStatusTransaction = new VerifyFundingStatus();
$idTransaction = 'YOUR-ID-PAYMENT-TRANSACTION';
$verifyFundingStatusTransaction->setIdTransaction($idTransaction);

try {
    $response = $client->verifyFundingStatus($verifyFundingStatusTransaction);
    echo $response->getStatusCode();
    echo $response->getBody();
    exit;

} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    die($e->getMessage());
}
```

Simulate:

```
require __DIR__ . '/vendor/autoload.php';

use Mobly\Boletoflex\Sdk\Transactions\Simulate;

$simulate = new Simulate();
$simulate->setBuyer($buyer);
$simulate->setReference('12345');
$simulate->setSeller($seller);
$simulate->setSource($source);
$simulate->setShipping($shipping);
$simulate->setCurrency('BRL');
$simulate->setPayment($payment);
$simulate->setCart($cart);

try {
    $response = $client->simulate($simulate);
    echo $response->getStatusCode();
    echo $response->getBody();
    exit;

} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    die($e->getMessage());
}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 53.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed998a56cf0b6bef5c88f6de0c137e6729d81ba2105266a7f4667e2eaadfd884?d=identicon)[mobly-git](/maintainers/mobly-git)

---

Top Contributors

[![diegojaldim](https://avatars.githubusercontent.com/u/10945774?v=4)](https://github.com/diegojaldim "diegojaldim (16 commits)")[![omangi](https://avatars.githubusercontent.com/u/8041308?v=4)](https://github.com/omangi "omangi (12 commits)")[![filipehiguchi](https://avatars.githubusercontent.com/u/101726113?v=4)](https://github.com/filipehiguchi "filipehiguchi (1 commits)")[![SamuelMagno](https://avatars.githubusercontent.com/u/41206618?v=4)](https://github.com/SamuelMagno "SamuelMagno (1 commits)")

### Embed Badge

![Health badge](/badges/mobly-boleto-flex/health.svg)

```
[![Health](https://phpackages.com/badges/mobly-boleto-flex/health.svg)](https://phpackages.com/packages/mobly-boleto-flex)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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