PHPackages                             sebastienheyd/laravel-systempay - 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. sebastienheyd/laravel-systempay

ActiveLibrary[Payment Processing](/categories/payments)

sebastienheyd/laravel-systempay
===============================

Systempay (Banque Populaire) form generator for Laravel

1.2.1(5y ago)11.5k2MITPHPPHP &gt;=7.2.0CI failing

Since Mar 5Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sebastienheyd/laravel-systempay)[ Packagist](https://packagist.org/packages/sebastienheyd/laravel-systempay)[ RSS](/packages/sebastienheyd-laravel-systempay/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (4)Versions (10)Used By (0)

Systempay form generator for Laravel
====================================

[](#systempay-form-generator-for-laravel)

[![Packagist](https://camo.githubusercontent.com/65d26ef743ecfe86ba1f7195e534c519c153631a05b484315f59e3bea221b077/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656261737469656e686579642f6c61726176656c2d73797374656d7061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sebastienheyd/laravel-systempay)[![Build Status](https://camo.githubusercontent.com/48f0d5e5a1a727328308672905fcdd9e688a56d1c69ceb78cfe1322b1da482bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73656261737469656e686579642f6c61726176656c2d73797374656d7061792f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sebastienheyd/laravel-systempay/build-status/master)[![StyleCI](https://camo.githubusercontent.com/105282f55fa7181d7a4f526c17b81755bd5b23d392cbdc9889edd624a9e4b661/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3137333936393537312f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/173969571)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/de1429fd63ab263a2827d99c6b2dea492311e7f7bc1edae0bc0aeef3eaba64b2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73656261737469656e686579642f6c61726176656c2d73797374656d7061792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sebastienheyd/laravel-systempay/?branch=master)[![Laravel](https://camo.githubusercontent.com/a8e3fe56235b901d43b4f740c0120a32f27ae254d638f2c18628929d3943a000/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e37253230254532253836253932253230382e782d677265656e3f6c6f676f3d4c61726176656c267374796c653d666c61742d737175617265)](https://laravel.com/)[![MIT License](https://camo.githubusercontent.com/3ace2d6c9379bb3b26b8f3e618a40dfc1afa219f582d000bf8136b47a0c607f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f726573746f6f72652f6c61726176656c2d73797374656d7061792e737667)](https://camo.githubusercontent.com/3ace2d6c9379bb3b26b8f3e618a40dfc1afa219f582d000bf8136b47a0c607f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f726573746f6f72652f6c61726176656c2d73797374656d7061792e737667)

Features
--------

[](#features)

- Fast and easy form generation for Systempay (by Banque Populaire)
- Support multiple site id for multiple stores within the same project
- Support sha1 and hmac-sha-256
- Blade extension for more flexibility

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

[](#installation)

1. Install the package

```
composer require sebastienheyd/laravel-systempay

```

2. Publish the config file

```
php artisan vendor:publish --provider="Sebastienheyd\Systempay\SystempayServiceProvider"

```

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

[](#configuration)

After publishing edit the default configuration file : [`config/systempay.php`](src/config/systempay.php)

```
return [
    'default' => [
        'site_id' => 'YOUR_SITE_ID',
        'key'     => env('SYSTEMPAY_SITE_KEY', 'YOUR_KEY'),
        'env'     => env('SYSTEMPAY_ENV', 'PRODUCTION'),
    ]
];
```

You need to set `YOUR_SITE_ID` and `YOUR_KEY` with your own values. This two values are given by Systempay.

### Hashing algorithms

[](#hashing-algorithms)

By default, the package will use hmac-sha-256 to generate the signature. To use sha1 you need to set `algo` to `sha1`in the configuration :

```
return [
    'default' => [
        // ...
        'algo'    => 'sha1'
    ]
];
```

### Specific parameters

[](#specific-parameters)

These parameters are set by default :

namedefault valuenotecurrency978[List of currency codes](https://www.iban.com/currency-codes)payment\_configSINGLESINGLE or MULTIPLEtrans\_date\[current datetime\]Generated automaticalypage\_actionPAYMENTaction\_modeINTERACTIVEversionV2signature\[generated\]Generated automaticalyAlso see [Systempay documentation](https://paiement.systempay.fr/doc/fr-FR/form-payment/quick-start-guide/envoyer-un-formulaire-de-paiement-en-post.html)

**NB** : you don't have to add the `vads_` prefix to parameters, the prefix will be automaticaly added. But you can also set the parameters with the `vads_` prefix, it will be automaticaly removed.

There is also possible to set some specific parameters to a configuration by setting `params` values.

Example :

```
return [
    'default' => [
        // ...
        'params'  => [
            'currency' => '826'
        ]
    ]
];
```

In this case, default configuration will use the currency code 826.

### Additional configuration

[](#additional-configuration)

You can add as many configuration as you need by adding a new key to the configuration file.

For example :

```
return [
    'default' => [
       // ...
    ],
    'store_uk' => [
        'site_id' => '123456',
        'key'     => env('SYSTEMPAY_UK_SITE_KEY', '12345678'),
        'env'     => env('SYSTEMPAY_UK_ENV', 'PRODUCTION'),
        'algo'    => 'sha256'
    ]
];
```

To use another configuration, call the `config` method, for example :

```
$systemPay = Systempay::config('store_uk')->set([
    'amount' => 12.34,
    'trans_id' => 123456
]);
```

Usage
-----

[](#usage)

In your controller :

```
