PHPackages                             lake-dynamics/sylius-monetico-plugin - 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. lake-dynamics/sylius-monetico-plugin

ActiveSylius-plugin[Payment Processing](/categories/payments)

lake-dynamics/sylius-monetico-plugin
====================================

Sylius plugin for Monetico payment gateway integration.

v1.3.1(4mo ago)1444MITPHPPHP ^8.2CI passing

Since Oct 11Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/lake-dynamics/SyliusMoneticoPlugin)[ Packagist](https://packagist.org/packages/lake-dynamics/sylius-monetico-plugin)[ RSS](/packages/lake-dynamics-sylius-monetico-plugin/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (30)Versions (23)Used By (0)

LakeDynamics Sylius Monetico Plugin
===================================

[](#lakedynamics-sylius-monetico-plugin)

[![License](https://camo.githubusercontent.com/409e3de772ff06e73061192b31f6bd98dc55b8c76c5039da6def3ff95de3922d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c616b652d64796e616d6963732f73796c6975732d6d6f6e657469636f2d706c7567696e2e737667)](LICENSE)

A Sylius plugin for integrating Monetico payment gateway into your e-commerce store.

Features
--------

[](#features)

- 💳 Complete Monetico payment gateway integration
- 🔒 Secure payment processing with MAC signature validation
- 🎨 Beautiful payment redirect page with loading animation
- 🌍 Support for both production and sandbox environments
- ✅ Full Sylius 2.0 Payment Request system compatibility
- 🔔 Automatic payment notification handling
- 📱 Responsive design

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

[](#requirements)

- PHP 8.2 or higher
- Sylius 2.0 or higher

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

[](#installation)

1. Install the plugin using Composer:

```
composer require lake-dynamics/sylius-monetico-plugin
```

2. Enable the plugin in your `config/bundles.php`:

```
return [
    // ...
    LakeDynamics\SyliusMoneticoPlugin\LakeDynamicsSyliusMoneticoPlugin::class => ['all' => true],
];
```

3. Import the plugin configuration in `config/packages/_sylius.yaml`:

```
imports:
    - { resource: "@LakeDynamicsSyliusMoneticoPlugin/config/config.yaml" }
```

4. Import the plugin routes in `config/routes.yaml`:

```
lake_dynamics_sylius_monetico:
    resource: "@LakeDynamicsSyliusMoneticoPlugin/config/routes/shop.yaml"
```

5. Clear the cache:

```
bin/console cache:clear
```

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

[](#configuration)

### 1. Create Payment Method

[](#1-create-payment-method)

1. Log in to the Sylius admin panel
2. Go to **Configuration &gt; Payment methods**
3. Click **Create**
4. Fill in the general information:
    - **Code**: `monetico` (or your preferred code)
    - **Name**: `Monetico`
    - **Enabled**: Check this box
5. Select **Monetico Payment Gateway** as the gateway
6. Configure the Monetico settings:
    - **TPE (Terminal Payment Electronic)**: Your Monetico TPE number
    - **Company ID (Société)**: Your Monetico company identifier
    - **Production Key**: Your Monetico encryption key
    - **Use Production Environment**: Check for production, uncheck for sandbox/test

### 2. Generate Encryption Key

[](#2-generate-encryption-key)

To encrypt sensitive payment configuration data:

```
bin/console sylius:payment:generate-key
```

### 3. Monetico Credentials

[](#3-monetico-credentials)

You'll receive the following credentials from Monetico:

- **TPE**: Your terminal identifier (e.g., `1234567`)
- **Company ID**: Your company code (e.g., `mycompany`)
- **Production Key**: A 40-character hexadecimal key for MAC signature generation

How It Works
------------

[](#how-it-works)

### Payment Flow

[](#payment-flow)

1. **Customer Checkout**: Customer selects Monetico as payment method
2. **Payment Initiation**: System creates a PaymentRequest with ACTION\_CAPTURE
3. **Field Preparation**: Plugin prepares payment fields and generates MAC signature
4. **Redirect**: Customer is redirected to Monetico payment page via auto-submit form
5. **Payment Processing**: Customer completes payment on Monetico's secure portal
6. **Notification**: Monetico sends payment result to your notification URL
7. **Validation**: Plugin validates MAC signature and updates payment status
8. **Completion**: Order is marked as paid or failed based on result

### Security

[](#security)

- **MAC Signature**: All data exchanged with Monetico is signed using HMAC SHA1
- **Encryption**: Payment credentials are encrypted in database
- **Validation**: All incoming notifications are validated before processing
- **HTTPS**: Production environment requires HTTPS

### Technical Details

[](#technical-details)

**Payment Fields Sent to Monetico:**

- TPE: Terminal identifier
- societe: Company identifier
- montant: Amount in EUR format (e.g., "10.50EUR")
- reference: Unique payment reference
- date: Payment date in GMT
- MAC: HMAC SHA1 signature
- texte-libre: Base64-encoded payment metadata (order ID, payment ID, payment request hash)
- contexte\_commande: Base64-encoded customer and billing data
- url\_retour\_ok: Success return URL
- url\_retour\_err: Error return URL

**Valid Payment Status:**

- `paiement`: Successful payment (production)
- `payetest`: Successful payment (test/sandbox)

Development
-----------

[](#development)

### Running Tests

[](#running-tests)

```
# PHPUnit
vendor/bin/phpunit

# Behat (non-JS)
vendor/bin/behat --strict --tags="~@javascript&&~@mink:chromedriver"

# PHPStan
vendor/bin/phpstan analyse -c phpstan.neon -l max src/

# Coding Standards
vendor/bin/ecs check
```

### Docker Development

[](#docker-development)

```
# Initialize environment
make init

# Initialize database
make database-init

# Load fixtures
make load-fixtures

# Run tests
make phpunit
make behat
make phpstan
make ecs
```

Troubleshooting
---------------

[](#troubleshooting)

### Payment Fails with "Invalid MAC signature"

[](#payment-fails-with-invalid-mac-signature)

**Problem**: Notification validation fails

**Solution**:

1. Verify your Production Key is correct (40 hex characters)
2. Ensure your server time is synchronized (GMT)
3. Check Monetico dashboard for the correct key
4. Verify notification URL is accessible from external networks

### Payment Page Doesn't Redirect

[](#payment-page-doesnt-redirect)

**Problem**: Auto-submit form doesn't work

**Solution**:

1. Check browser console for JavaScript errors
2. Verify payment fields are properly generated
3. Ensure Monetico URL is accessible
4. Check if Content Security Policy allows form submission

### Notification URL Not Receiving Callbacks

[](#notification-url-not-receiving-callbacks)

**Problem**: Monetico can't reach your notification endpoint

**Solution**:

1. Ensure your server is accessible from external networks
2. Verify URL in admin matches: `https://yourdomain.com/payment/monetico/notify`
3. Check firewall rules allow Monetico IPs
4. Configure this URL in your Monetico backend for server-to-server notifications

### Production vs Sandbox

[](#production-vs-sandbox)

**Sandbox Testing**:

- Use sandbox credentials from Monetico
- Uncheck "Use Production Environment" in payment method config
- Payment URL: `https://p.monetico-services.com/test/paiement.cgi`

**Production**:

- Use production credentials from Monetico
- Check "Use Production Environment"
- Payment URL: `https://p.monetico-services.com/paiement.cgi`
- **Requires HTTPS**

Support
-------

[](#support)

- **Documentation**: [Monetico Documentation](https://www.monetico-paiement.fr/)
- **Sylius Docs**: [docs.sylius.com](https://docs.sylius.com/)
- **Issues**: [GitHub Issues](https://github.com/lake-dynamics/sylius-monetico-plugin/issues)

License
-------

[](#license)

This plugin is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Credits
-------

[](#credits)

Developed by [LakeDynamics](https://github.com/lake-dynamics)

Monetico is a trademark of Groupe BPCE.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance75

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Every ~7 days

Recently: every ~16 days

Total

20

Last Release

136d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4a17ebc908b77fe920018f2d035555047f585d9f5de1e61768e804f38caf317?d=identicon)[lake-dynamics](/maintainers/lake-dynamics)

---

Top Contributors

[![baptiste-dulac](https://avatars.githubusercontent.com/u/6490931?v=4)](https://github.com/baptiste-dulac "baptiste-dulac (25 commits)")

---

Tags

syliuspaymentsylius-pluginmonetico

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lake-dynamics-sylius-monetico-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/lake-dynamics-sylius-monetico-plugin/health.svg)](https://phpackages.com/packages/lake-dynamics-sylius-monetico-plugin)
```

###  Alternatives

[sylius/invoicing-plugin

Invoicing plugin for Sylius.

891.1M2](/packages/sylius-invoicing-plugin)[sylius/paypal-plugin

PayPal plugin for Sylius.

461.5M7](/packages/sylius-paypal-plugin)[flux-se/sylius-payum-stripe-plugin

Payum Stripe gateways plugin for Sylius.

61353.3k](/packages/flux-se-sylius-payum-stripe-plugin)

PHPackages © 2026

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