PHPackages                             lexik/paybox-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. lexik/paybox-bundle

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

lexik/paybox-bundle
===================

LexikPayboxBundle eases the implementation of the Paybox payment system.

v2.1.3(7y ago)40133.6k—8.6%47[7 issues](https://github.com/lexik/LexikPayboxBundle/issues)[2 PRs](https://github.com/lexik/LexikPayboxBundle/pulls)MITPHPPHP &gt;=5.5.9

Since Jan 8Pushed 3y ago14 watchersCompare

[ Source](https://github.com/lexik/LexikPayboxBundle)[ Packagist](https://packagist.org/packages/lexik/paybox-bundle)[ Docs](https://github.com/lexik/LexikPayboxBundle)[ RSS](/packages/lexik-paybox-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (13)Used By (0)

LexikPayboxBundle
=================

[](#lexikpayboxbundle)

[![Build Status](https://camo.githubusercontent.com/ae6833731a45292f978603aca4c87cadd34595c3e664e7ff1a5f78b19f957358/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6c6578696b2f4c6578696b506179626f7842756e646c652e706e67)](http://travis-ci.org/lexik/LexikPayboxBundle)[![Latest Stable Version](https://camo.githubusercontent.com/15cddc98bf474d402391ddd36d9bed1868499304ccde19660e8b6d12a285c1bf/68747470733a2f2f706f7365722e707567782e6f72672f6c6578696b2f706179626f782d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/lexik/paybox-bundle)[![SensioLabsInsight](https://camo.githubusercontent.com/db030abb9c67d5186f17d48c5b4bc995e8e22d6e4a6e02a102a625943a01559c/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33373837313861302d656137372d343539322d383965622d3962663437323134656663392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/378718a0-ea77-4592-89eb-9bf47214efc9)

Important!
----------

[](#important)

**This bundle is partially maintained. No new features will be added but some PR will be merged for compatibility or security.**

LexikPayboxBundle makes the use of [Paybox](http://www.paybox.com) payment system easier by doing all the boring things for you.

LexikPayboxBundle silently does :

- hmac hash calculation of parameters during request.
- server testing before request to be sure it is up.
- signature verification with openssl on ipn response.
- triggers an event on response.

You only need to provide parameters of your transaction, customize the response page and wait for the event triggered on ipn response.

Requirements
------------

[](#requirements)

- PECL hash &gt;= 1.1
- openssl enabled

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

[](#installation)

Installation with composer :

```
composer require lexik/paybox-bundle
```

Add this bundle to your app/AppKernel.php :

```
public function registerBundles()
{
    return array(
        // ...
        new Lexik\Bundle\PayboxBundle\LexikPayboxBundle(),
        // ...
    );
}
```

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

[](#configuration)

Your personnal account informations must be set in your config.yml

```
# Lexik Paybox Bundle
lexik_paybox:
    parameters:
        production: false        # Switches between Paybox test and production servers (preprod-tpe  tpe)
        site:        '9999999'   # Site number provided by the bank
        rank:        '99'        # Rank number provided by the bank
        login:       '999999999' # Customer's login provided by Paybox
        hmac:
            key: '01234...BCDEF' # Key used to compute the hmac hash, provided by Paybox
```

Additional configuration:

```
lexik_paybox:
    parameters:
        currencies:  # Optionnal parameters, this is the default value
            - '036'  # AUD
            - '124'  # CAD
            - '756'  # CHF
            - '826'  # GBP
            - '840'  # USD
            - '978'  # EUR
        hmac:
            algorithm:      sha512 # signature algorithm
            signature_name: Sign   # customize the signature parameter name
```

The routing collection must be set in your routing.yml

```
# Lexik Paybox Bundle
lexik_paybox:
    resource: '@LexikPayboxBundle/Resources/config/routing.yml'
```

Usage of Paybox System
----------------------

[](#usage-of-paybox-system)

The bundle includes a sample controller `SampleController.php` with two actions.

```
...
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

/**
 * Sample action to call a payment.
 * It create the form to submit with all parameters.
 */
public function callAction()
{
    $paybox = $this->get('lexik_paybox.request_handler');
    $paybox->setParameters(array(
        'PBX_CMD'          => 'CMD'.time(),
        'PBX_DEVISE'       => '978',
        'PBX_PORTEUR'      => 'test@paybox.com',
        'PBX_RETOUR'       => 'Mt:M;Ref:R;Auto:A;Erreur:E',
        'PBX_TOTAL'        => '1000',
        'PBX_TYPEPAIEMENT' => 'CARTE',
        'PBX_TYPECARTE'    => 'CB',
        'PBX_EFFECTUE'     => $this->generateUrl('lexik_paybox_sample_return', array('status' => 'success'), UrlGeneratorInterface::ABSOLUTE_URL),
        'PBX_REFUSE'       => $this->generateUrl('lexik_paybox_sample_return', array('status' => 'denied'), UrlGeneratorInterface::ABSOLUTE_URL),
        'PBX_ANNULE'       => $this->generateUrl('lexik_paybox_sample_return', array('status' => 'canceled'), UrlGeneratorInterface::ABSOLUTE_URL),
        'PBX_RUF1'         => 'POST',
        'PBX_REPONDRE_A'   => $this->generateUrl('lexik_paybox_ipn', array('time' => time()), UrlGeneratorInterface::ABSOLUTE_URL),
    ));

    return $this->render(
        'LexikPayboxBundle:Sample:index.html.twig',
        array(
            'url'  => $paybox->getUrl(),
            'form' => $paybox->getForm()->createView(),
        )
    );
}
...
/**
 * Sample action of a confirmation payment page on witch the user is sent
 * after he seizes his payment informations on the Paybox's platform.
 * This action must only containts presentation logic.
 */
public function responseAction($status)
{
    return $this->render(
        'LexikPayboxBundle:Sample:return.html.twig',
        array(
            'status'     => $status,
            'parameters' => $this->getRequest()->query,
        )
    );
}
...
```

The getUrl() method silently does a server check and throws an exception if the destination server does not respond.

The payment confirmation in your business logic must be done when the instant payment notification (IPN) occurs. The plugin contains a controller with an action that manages this IPN and triggers an event. The event contains all data transmetted during the request and a boolean that tells if signature verification was successful.

The bundle contains a listener example that simply create a file on each ipn call.

```
namespace Lexik\Bundle\PayboxBundle\Listener;

use Symfony\Component\Filesystem\Filesystem;

use Lexik\Bundle\PayboxBundle\Event\PayboxResponseEvent;

/**
 * Simple listener that create a file for each ipn call.
 */
class PayboxResponseListener
{
    private $rootDir;

    private $filesystem;

    /**
     * Constructor.
     *
     * @param string     $rootDir
     * @param Filesystem $filesystem
     */
    public function __construct($rootDir, Filesystem $filesystem)
    {
        $this->rootDir = $rootDir;
        $this->filesystem = $filesystem;
    }

    /**
     * Creates a txt file containing all parameters for each IPN.
     *
     * @param  PayboxResponseEvent $event
     */
    public function onPayboxIpnResponse(PayboxResponseEvent $event)
    {
        $path = $this->rootDir . '/../data/' . date('Y\/m\/d\/');
        $this->filesystem->mkdir($path);

        $content = sprintf("Signature verification : %s\n", $event->isVerified() ? 'OK' : 'KO');
        foreach ($event->getData() as $key => $value) {
            $content .= sprintf("%s:%s\n", $key, $value);
        }

        file_put_contents($path . time() . '.txt', $content);
    }
}
```

To create your own listener, you just have to make it wait for the "paybox.ipn\_response" event. For example the listener of the bundle:

```
parameters:
    lexik_paybox.sample_response_listener.class: 'Lexik\Bundle\PayboxBundle\Listener\SampleIpnListener'

services:
    ...
    lexik_paybox.sample_response_listener:
        class: %lexik_paybox.sample_response_listener.class%
        arguments: [ %kernel.root_dir%, @filesystem ]
        tags:
            - { name: kernel.event_listener, event: paybox.ipn_response, method: onPayboxIpnResponse }
```

Resources
---------

[](#resources)

All transactions parameters are available in the [official documentation](http://www1.paybox.com/telechargement_focus.aspx?cat=3).

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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

Every ~200 days

Recently: every ~301 days

Total

12

Last Release

2668d ago

Major Versions

v1.1.0 → v2.0.02015-08-11

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.2

v2.1.0PHP &gt;=5.5.9

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/077eba6702dc23a795ee2262dff92505e3c8ead08f7cb205be80d8aae0a6b8e5?d=identicon)[sdieunidou](/maintainers/sdieunidou)

![](https://www.gravatar.com/avatar/9afe5fb1ecbb4f6432e1ea736f9783b6d138c4484889922acb9b3354188e60a0?d=identicon)[jeremyb](/maintainers/jeremyb)

![](https://www.gravatar.com/avatar/3c887878d9155bd964d771d21fe5dd1ac3ceb7f6303d94d684f6d17905f302a1?d=identicon)[cedric-g](/maintainers/cedric-g)

![](https://www.gravatar.com/avatar/5856577d04078ad09b0b1d547c46153d2fbe996e709f22e2d1347a2555072f95?d=identicon)[Olineuve](/maintainers/Olineuve)

---

Top Contributors

[![soullivaneuh](https://avatars.githubusercontent.com/u/1698357?v=4)](https://github.com/soullivaneuh "soullivaneuh (15 commits)")[![fabienpomerol](https://avatars.githubusercontent.com/u/496277?v=4)](https://github.com/fabienpomerol "fabienpomerol (12 commits)")[![acidjames](https://avatars.githubusercontent.com/u/2505667?v=4)](https://github.com/acidjames "acidjames (8 commits)")[![nykopol](https://avatars.githubusercontent.com/u/2706685?v=4)](https://github.com/nykopol "nykopol (5 commits)")[![Olineuve](https://avatars.githubusercontent.com/u/1230697?v=4)](https://github.com/Olineuve "Olineuve (3 commits)")[![jeremyb](https://avatars.githubusercontent.com/u/134588?v=4)](https://github.com/jeremyb "jeremyb (2 commits)")[![Jihell](https://avatars.githubusercontent.com/u/3269035?v=4)](https://github.com/Jihell "Jihell (1 commits)")[![JulienItard](https://avatars.githubusercontent.com/u/1370893?v=4)](https://github.com/JulienItard "JulienItard (1 commits)")[![nicolasricci](https://avatars.githubusercontent.com/u/208481?v=4)](https://github.com/nicolasricci "nicolasricci (1 commits)")[![vtedesco](https://avatars.githubusercontent.com/u/706825?v=4)](https://github.com/vtedesco "vtedesco (1 commits)")[![yann-eugone](https://avatars.githubusercontent.com/u/1303838?v=4)](https://github.com/yann-eugone "yann-eugone (1 commits)")[![adrien-robert](https://avatars.githubusercontent.com/u/4320990?v=4)](https://github.com/adrien-robert "adrien-robert (1 commits)")[![aleksbrgt](https://avatars.githubusercontent.com/u/8698469?v=4)](https://github.com/aleksbrgt "aleksbrgt (1 commits)")[![babaorum](https://avatars.githubusercontent.com/u/6162081?v=4)](https://github.com/babaorum "babaorum (1 commits)")[![fungio](https://avatars.githubusercontent.com/u/2470117?v=4)](https://github.com/fungio "fungio (1 commits)")[![guillaumes-acelys](https://avatars.githubusercontent.com/u/52737358?v=4)](https://github.com/guillaumes-acelys "guillaumes-acelys (1 commits)")

---

Tags

bundlephpsymfonysymfony-bundlebundleSymfony2paymentpaybox

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lexik-paybox-bundle/health.svg)

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

###  Alternatives

[paymentsuite/paymentsuite

PaymentSuite is an easy implementation for lot of Payment Methods for Symfony projects

2715.5k2](/packages/paymentsuite-paymentsuite)[miracode/stripe-bundle

Symfony bundle to integrate Stripe PHP SDK. Ability to save Stripe objects in database using Doctrine.

1016.1k](/packages/miracode-stripe-bundle)

PHPackages © 2026

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