PHPackages                             haithemdev/flouci-bundle - 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. haithemdev/flouci-bundle

ActiveSymfony-bundle[Payment Processing](/categories/payments)

haithemdev/flouci-bundle
========================

Ready-to-use Symfony Bundle for Flouci Payment Gateway. Optimized for multi-account and client-specific integrations with event-driven architecture.

v1.0.0(3mo ago)02MITPHPPHP &gt;=8.1CI passing

Since Apr 3Pushed 3mo agoCompare

[ Source](https://github.com/haithemdev/flouci-bundle)[ Packagist](https://packagist.org/packages/haithemdev/flouci-bundle)[ RSS](/packages/haithemdev-flouci-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

Flouci Symfony Bundle
=====================

[](#flouci-symfony-bundle)

[![Tests](https://github.com/haithemdev/flouci-bundle/actions/workflows/tests.yml/badge.svg)](https://github.com/haithemdev/flouci-bundle/actions)[![Latest Stable Version](https://camo.githubusercontent.com/3b000e60cc095bac8fa622b779e0e116290a1c7f6a16c7cb0cb0db05516236fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6861697468656d6465762f666c6f7563692d62756e646c652e737667)](https://packagist.org/packages/haithemdev/flouci-bundle)[![License](https://camo.githubusercontent.com/363a99e30195e63a2d9b58346f5bd853823c03383e043d751b0d88afb3d23860/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6861697468656d6465762f666c6f7563692d62756e646c652e737667)](https://github.com/haithemdev/flouci-bundle/blob/main/LICENSE)

A robust Symfony bundle for integrating the **Flouci Payment Gateway API v2**. This bundle is designed for modern Symfony applications, offering support for multiple API accounts (static or dynamic), event-driven architecture, and built-in webhook handling.

Features
--------

[](#features)

- ✅ **Simple &amp; Advanced Configuration**: Single account or multiple account support.
- ✅ **Dynamic Accounts**: Create Flouci services on-the-fly for different clients (multi-tenancy).
- ✅ **Event-Driven**: Listen to `FlouciEvents::PAYMENT_VERIFIED` to handle post-payment logic.
- ✅ **Built-in Webhook**: Ready-to-use controller for payment notifications.
- ✅ **Developer Friendly**: Strong typing and custom exceptions for easy debugging.

Installation
------------

[](#installation)

```
composer require haithemdev/flouci-bundle
```

Configuration
-------------

[](#configuration)

### Simple Mode (Standard)

[](#simple-mode-standard)

```
# config/packages/flouci_symfony.yaml
flouci_symfony:
    app_token: '%env(FLOUCI_APP_TOKEN)%'
    app_secret: '%env(FLOUCI_APP_SECRET)%'
```

### Advanced Mode (Multiple Accounts)

[](#advanced-mode-multiple-accounts)

```
# config/packages/flouci_symfony.yaml
flouci_symfony:
    accounts:
        main:
            app_token: '...'
            app_secret: '...'
        business:
            app_token: '...'
            app_secret: '...'
```

Usage
-----

[](#usage)

### 1. Generating a Payment Link

[](#1-generating-a-payment-link)

```
use Flouci\SymfonyBundle\Service\FlouciServiceInterface;

public function checkout(FlouciServiceInterface $flouci)
{
    $result = $flouci->generatePaymentLink(
        10.500, // Amount in TND
        'order_123',
        'https://your-app.com/success',
        'https://your-app.com/fail'
    );

    return $this->redirect($result['link']);
}
```

### 2. Handling Payments (Events)

[](#2-handling-payments-events)

Create a listener to handle successful payments:

```
use Flouci\SymfonyBundle\Event\FlouciEvents;
use Flouci\SymfonyBundle\Event\PaymentVerifiedEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;

#[AsEventListener(event: FlouciEvents::PAYMENT_VERIFIED)]
public function onPaymentVerified(PaymentVerifiedEvent $event): void
{
    $data = $event->getPaymentData();
    $orderId = $event->getTrackingId();

    if ($event->getStatus() === 'SUCCESS') {
        // Update your order in database
    }
}
```

### 3. Dynamic Client Accounts (No configuration needed)

[](#3-dynamic-client-accounts-no-configuration-needed)

If your API keys are stored in a database (per client):

```
use Flouci\SymfonyBundle\Service\FlouciManager;

public function pay(Client $client, FlouciManager $manager)
{
    // Automatically uses default if $client keys are null, or creates a new service if they exist.
    $flouci = $manager->getService($client->getToken(), $client->getSecret());

    $flouci->generatePaymentLink(...);
}
```

Built-in Webhook
----------------

[](#built-in-webhook)

This bundle includes a ready-to-use webhook route. Just point Flouci's webhook settings to: `https://your-app.com/flouci/webhook/default`

Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

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

92d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43a4df5b0b5474e44ddedbb0914282481cc356aa399e23dc3b832f2d7421cd85?d=identicon)[haithemdev](/maintainers/haithemdev)

---

Top Contributors

[![millesima-dev](https://avatars.githubusercontent.com/u/162648461?v=4)](https://github.com/millesima-dev "millesima-dev (3 commits)")

---

Tags

symfonybundlepaymentgatewaytunisiaflouci

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/haithemdev-flouci-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/haithemdev-flouci-bundle/health.svg)](https://phpackages.com/packages/haithemdev-flouci-bundle)
```

###  Alternatives

[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

66529.9k11](/packages/web-auth-webauthn-symfony-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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