{"id":15080906,"url":"https://github.com/lexik/lexikpayboxbundle","last_synced_at":"2025-10-05T13:30:31.453Z","repository":{"id":5018166,"uuid":"6176813","full_name":"lexik/LexikPayboxBundle","owner":"lexik","description":"LexikPayboxBundle eases the implementation of the Paybox payment system","archived":true,"fork":false,"pushed_at":"2023-01-24T17:00:03.000Z","size":230,"stargazers_count":40,"open_issues_count":13,"forks_count":47,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-01-17T00:41:37.823Z","etag":null,"topics":["bundle","php","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fluent-ffmpeg/node-fluent-ffmpeg","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lexik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-11T16:17:46.000Z","updated_at":"2024-03-15T13:09:56.000Z","dependencies_parsed_at":"2023-02-13T23:45:51.029Z","dependency_job_id":null,"html_url":"https://github.com/lexik/LexikPayboxBundle","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexik%2FLexikPayboxBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexik%2FLexikPayboxBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexik%2FLexikPayboxBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexik%2FLexikPayboxBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lexik","download_url":"https://codeload.github.com/lexik/LexikPayboxBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235399012,"owners_count":18983814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","php","symfony","symfony-bundle"],"created_at":"2024-09-25T05:32:51.150Z","updated_at":"2025-10-05T13:30:26.143Z","avatar_url":"https://github.com/lexik.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"LexikPayboxBundle\n=================\n\n[![Build Status](https://secure.travis-ci.org/lexik/LexikPayboxBundle.png)](http://travis-ci.org/lexik/LexikPayboxBundle)\n[![Latest Stable Version](https://poser.pugx.org/lexik/paybox-bundle/v/stable.svg)](https://packagist.org/packages/lexik/paybox-bundle)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/378718a0-ea77-4592-89eb-9bf47214efc9/mini.png)](https://insight.sensiolabs.com/projects/378718a0-ea77-4592-89eb-9bf47214efc9)\n\n## Important!\n**This bundle is partially maintained. No new features will be added but some PR will be merged for compatibility or security.**\n\nLexikPayboxBundle makes the use of [Paybox](http://www.paybox.com) payment system easier by doing all the boring things for you.\n\nLexikPayboxBundle silently does :\n * hmac hash calculation of parameters during request.\n * server testing before request to be sure it is up.\n * signature verification with openssl on ipn response.\n * triggers an event on response.\n\nYou only need to provide parameters of your transaction, customize the response page\nand wait for the event triggered on ipn response.\n\nRequirements\n------------\n\n * PECL hash \u003e= 1.1\n * openssl enabled\n\nInstallation\n------------\n\nInstallation with composer :\n\n```bash\ncomposer require lexik/paybox-bundle\n```\n\nAdd this bundle to your app/AppKernel.php :\n\n``` php\npublic function registerBundles()\n{\n    return array(\n        // ...\n        new Lexik\\Bundle\\PayboxBundle\\LexikPayboxBundle(),\n        // ...\n    );\n}\n```\n\nConfiguration\n-------------\n\nYour personnal account informations must be set in your config.yml\n\n```yml\n# Lexik Paybox Bundle\nlexik_paybox:\n    parameters:\n        production: false        # Switches between Paybox test and production servers (preprod-tpe \u003c\u003e tpe)\n        site:        '9999999'   # Site number provided by the bank\n        rank:        '99'        # Rank number provided by the bank\n        login:       '999999999' # Customer's login provided by Paybox\n        hmac:\n            key: '01234...BCDEF' # Key used to compute the hmac hash, provided by Paybox\n```\n\nAdditional configuration:\n\n```yml\nlexik_paybox:\n    parameters:\n        currencies:  # Optionnal parameters, this is the default value\n            - '036'  # AUD\n            - '124'  # CAD\n            - '756'  # CHF\n            - '826'  # GBP\n            - '840'  # USD\n            - '978'  # EUR\n        hmac:\n            algorithm:      sha512 # signature algorithm\n            signature_name: Sign   # customize the signature parameter name\n```\n\nThe routing collection must be set in your routing.yml\n\n```yml\n# Lexik Paybox Bundle\nlexik_paybox:\n    resource: '@LexikPayboxBundle/Resources/config/routing.yml'\n```\n\nUsage of Paybox System\n----------------------\n\nThe bundle includes a sample controller `SampleController.php` with two actions.\n\n```php\n...\nuse Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface;\n\n/**\n * Sample action to call a payment.\n * It create the form to submit with all parameters.\n */\npublic function callAction()\n{\n    $paybox = $this-\u003eget('lexik_paybox.request_handler');\n    $paybox-\u003esetParameters(array(\n        'PBX_CMD'          =\u003e 'CMD'.time(),\n        'PBX_DEVISE'       =\u003e '978',\n        'PBX_PORTEUR'      =\u003e 'test@paybox.com',\n        'PBX_RETOUR'       =\u003e 'Mt:M;Ref:R;Auto:A;Erreur:E',\n        'PBX_TOTAL'        =\u003e '1000',\n        'PBX_TYPEPAIEMENT' =\u003e 'CARTE',\n        'PBX_TYPECARTE'    =\u003e 'CB',\n        'PBX_EFFECTUE'     =\u003e $this-\u003egenerateUrl('lexik_paybox_sample_return', array('status' =\u003e 'success'), UrlGeneratorInterface::ABSOLUTE_URL),\n        'PBX_REFUSE'       =\u003e $this-\u003egenerateUrl('lexik_paybox_sample_return', array('status' =\u003e 'denied'), UrlGeneratorInterface::ABSOLUTE_URL),\n        'PBX_ANNULE'       =\u003e $this-\u003egenerateUrl('lexik_paybox_sample_return', array('status' =\u003e 'canceled'), UrlGeneratorInterface::ABSOLUTE_URL),\n        'PBX_RUF1'         =\u003e 'POST',\n        'PBX_REPONDRE_A'   =\u003e $this-\u003egenerateUrl('lexik_paybox_ipn', array('time' =\u003e time()), UrlGeneratorInterface::ABSOLUTE_URL),\n    ));\n\n    return $this-\u003erender(\n        'LexikPayboxBundle:Sample:index.html.twig',\n        array(\n            'url'  =\u003e $paybox-\u003egetUrl(),\n            'form' =\u003e $paybox-\u003egetForm()-\u003ecreateView(),\n        )\n    );\n}\n...\n/**\n * Sample action of a confirmation payment page on witch the user is sent\n * after he seizes his payment informations on the Paybox's platform.\n * This action must only containts presentation logic.\n */\npublic function responseAction($status)\n{\n    return $this-\u003erender(\n        'LexikPayboxBundle:Sample:return.html.twig',\n        array(\n            'status'     =\u003e $status,\n            'parameters' =\u003e $this-\u003egetRequest()-\u003equery,\n        )\n    );\n}\n...\n```\n\nThe getUrl() method silently does a server check and throws an exception if the destination server does not respond.\n\nThe payment confirmation in your business logic must be done when the instant payment notification (IPN) occurs.\nThe plugin contains a controller with an action that manages this IPN and triggers an event.\nThe event contains all data transmetted during the request and a boolean that tells if signature verification was successful.\n\nThe bundle contains a listener example that simply create a file on each ipn call.\n\n```php\nnamespace Lexik\\Bundle\\PayboxBundle\\Listener;\n\nuse Symfony\\Component\\Filesystem\\Filesystem;\n\nuse Lexik\\Bundle\\PayboxBundle\\Event\\PayboxResponseEvent;\n\n/**\n * Simple listener that create a file for each ipn call.\n */\nclass PayboxResponseListener\n{\n    private $rootDir;\n\n    private $filesystem;\n\n    /**\n     * Constructor.\n     *\n     * @param string     $rootDir\n     * @param Filesystem $filesystem\n     */\n    public function __construct($rootDir, Filesystem $filesystem)\n    {\n        $this-\u003erootDir = $rootDir;\n        $this-\u003efilesystem = $filesystem;\n    }\n\n    /**\n     * Creates a txt file containing all parameters for each IPN.\n     *\n     * @param  PayboxResponseEvent $event\n     */\n    public function onPayboxIpnResponse(PayboxResponseEvent $event)\n    {\n        $path = $this-\u003erootDir . '/../data/' . date('Y\\/m\\/d\\/');\n        $this-\u003efilesystem-\u003emkdir($path);\n\n        $content = sprintf(\"Signature verification : %s\\n\", $event-\u003eisVerified() ? 'OK' : 'KO');\n        foreach ($event-\u003egetData() as $key =\u003e $value) {\n            $content .= sprintf(\"%s:%s\\n\", $key, $value);\n        }\n\n        file_put_contents($path . time() . '.txt', $content);\n    }\n}\n```\n\nTo create your own listener, you just have to make it wait for the \"paybox.ipn_response\" event.\nFor example the listener of the bundle:\n\n```yml\nparameters:\n    lexik_paybox.sample_response_listener.class: 'Lexik\\Bundle\\PayboxBundle\\Listener\\SampleIpnListener'\n\nservices:\n    ...\n    lexik_paybox.sample_response_listener:\n        class: %lexik_paybox.sample_response_listener.class%\n        arguments: [ %kernel.root_dir%, @filesystem ]\n        tags:\n            - { name: kernel.event_listener, event: paybox.ipn_response, method: onPayboxIpnResponse }\n```\n\nResources\n---------\n\nAll transactions parameters are available in the [official documentation](http://www1.paybox.com/telechargement_focus.aspx?cat=3).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexik%2Flexikpayboxbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexik%2Flexikpayboxbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexik%2Flexikpayboxbundle/lists"}