PHPackages                             flowinpay/flowinpay-php - 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. flowinpay/flowinpay-php

ActiveLibrary

flowinpay/flowinpay-php
=======================

SDK oficial da FlowinPay — gateway de pagamentos PIX com split automático, saques e webhooks.

v0.1.0(1mo ago)00MITPHPPHP &gt;=8.1

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/flowinpay/flowinpay-php)[ Packagist](https://packagist.org/packages/flowinpay/flowinpay-php)[ Docs](https://app.flowinpay.com.br)[ RSS](/packages/flowinpay-flowinpay-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

FlowinPay — SDK PHP
===================

[](#flowinpay--sdk-php)

SDK oficial da [FlowinPay](https://app.flowinpay.com.br) — gateway de pagamentos **PIX** brasileiro com **split automático**, saque na hora, checkout e webhooks assinados.

- ⚡ Cobranças PIX instantâneas (QR Code + copia-e-cola) em uma chamada
- 🔀 Split de pagamento (porcentagem ou valor fixo) entre até 3 recebedores
- 💸 Saques via PIX (cash out)
- 🔒 Verificação de assinatura de webhook (HMAC-SHA256)
- 📦 Zero dependências (usa cURL nativo) — funciona até em hospedagem compartilhada

Requisitos
----------

[](#requisitos)

PHP **8.1+** com as extensões `curl` e `json`.

Instalação
----------

[](#instalação)

```
composer require flowinpay/flowinpay-php
```

Início rápido
-------------

[](#início-rápido)

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

use FlowinPay\FlowinPay;

$fp = new FlowinPay('fpk_sua_chave_aqui');

// Cria uma cobrança PIX de R$ 100 com split
$res = $fp->charges->create([
    'value' => 100,
    'description' => 'Pedido #123',
    'callbackUrl' => 'https://seusite.com/webhooks/flowinpay',
    'split' => [
        ['type' => 'percentage', 'value' => 10, 'recipient' => 'PUBLIC_ID_DO_COPRODUTOR'],
    ],
]);

$charge = $res['charge'];
echo $charge['br_code'];          // PIX copia-e-cola (exiba para o pagador)
echo $charge['payment_link_url']; // link de pagamento pronto
echo $charge['qr_code_image'];    // URL do QR Code
```

> A **App ID** (`fpk_...`) você gera no painel em **Integrações → API Keys**, com os escopos desejados.

Cobranças
---------

[](#cobranças)

```
$res = $fp->charges->create(['value' => 50, 'description' => 'Curso']);
$one = $fp->charges->get($res['charge']['id']);
$all = $fp->charges->list();
$fp->charges->cancel($res['charge']['id']);
```

Saldo e saques
--------------

[](#saldo-e-saques)

```
$saldo = $fp->balance->get();
echo $saldo['balance']['available'];

$fp->withdrawals->create([
    'value' => 100,
    'pix_key' => 'voce@email.com',
    'pix_key_type' => 'email', // 'cpf' | 'cnpj' | 'email' | 'phone' | 'random'
]);
```

Webhooks
--------

[](#webhooks)

### Registrar

[](#registrar)

```
$res = $fp->webhooks->create([
    'url' => 'https://seusite.com/webhooks/flowinpay',
    'events' => ['charge.completed', 'charge.expired'],
]);
// ⚠️ Guarde o secret — só aparece nesta resposta:
echo $res['webhook']['secret']; // whsec_...
```

### Verificar a assinatura

[](#verificar-a-assinatura)

A FlowinPay assina cada webhook com `X-FlowinPay-Signature` = `HMAC-SHA256(corpo_bruto, secret)`. **Use sempre o corpo bruto** (`php://input`).

```
use FlowinPay\Webhook;
use FlowinPay\FlowinPayException;

$raw = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_FLOWINPAY_SIGNATURE'] ?? null;

try {
    $evento = Webhook::parse($raw, $sig, 'whsec_seu_secret');
} catch (FlowinPayException $e) {
    http_response_code(401);
    exit('assinatura inválida');
}

http_response_code(200); // responda rápido (timeout de 5s)

if ($evento['event'] === 'charge.completed') {
    // libere o produto...
    error_log('Pago: ' . $evento['charge']['correlation_id']);
}
```

Eventos: `charge.created`, `charge.completed`, `charge.expired`, `charge.cancelled`, `charge.refunded`, `withdrawal.completed`, `withdrawal.failed`, `dispute.opened`, `dispute.accepted`, `dispute.rejected`, `dispute.cancelled`.

Tratamento de erros
-------------------

[](#tratamento-de-erros)

```
use FlowinPay\FlowinPayException;

try {
    $fp->charges->create(['value' => 1]); // abaixo do mínimo
} catch (FlowinPayException $e) {
    echo $e->status;   // 422
    echo $e->getMessage();
    print_r($e->errors); // erros de validação por campo
}
```

Documentação
------------

[](#documentação)

- Docs completos:
- Versão legível por IA:

Licença
-------

[](#licença)

MIT © FlowinPay

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance92

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

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

46d ago

### Community

Maintainers

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

---

Tags

webhookspaymentsgatewaysplitpagamentospixbrasilflowinpay

### Embed Badge

![Health badge](/badges/flowinpay-flowinpay-php/health.svg)

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

###  Alternatives

[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60517.2M104](/packages/mollie-mollie-api-php)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3614.9M41](/packages/mollie-laravel-mollie)[mollie/magento2

Mollie Payment Module for Magento 2

1162.0M19](/packages/mollie-magento2)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

271.9M1](/packages/mollie-oauth2-mollie-php)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4954.1k](/packages/sebdesign-laravel-viva-payments)[mrprompt/cielo

Integration with Cielo gateway.

482.3k1](/packages/mrprompt-cielo)

PHPackages © 2026

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