# payplug/payplug-magento2

> Payplug Payments module for Magento 2

`composer require payplug/payplug-magento2`

Canonical URL: https://packagento.com/payplug/payplug-magento2

## At a glance

- **Vendor**: payplug (https://packagento.com/payplug.md)
- **Latest version**: 4.7.1 — released 2026-06-03
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/payplug/payplug-magento2 and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require payplug/payplug-magento2:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Payplug Payments module for Magento 2

## README

### Installation 

#### Pre-requirements

- Adobe Commerce / Magento Open Source **2.4.1 – 2.4.8**
- PHP **8.1 – 8.4**
- PHP extension **openssl** (required)

#### Installation via Magento Back Office

You can follow Magento’s instruction provided at
[https://devdocs.magento.com/guides/v2.3/comp-mgr/extens-man/extensman-main-pg.html](https://devdocs.magento.com/guides/v2.3/comp-mgr/extens-man/extensman-main-pg.html)

#### Installation via composer

##### Composer

How to get Composer : 
Please follow instructions on [https://getcomposer.org/download/](https://getcomposer.org/download/)

How to update your Composer version : 
Please follow instructions on [https://getcomposer.org/doc/03-cli.md#self-update-selfupdate-](https://getcomposer.org/doc/03-cli.md#self-update-selfupdate-)

##### Installation

Run the following commands in Magento root directory:

```
composer require payplug/payplug-magento2  # (*)
composer install
php bin/magento module:enable Payplug_Payments --clear-static-content
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy <languages>  # (**)(***)
php bin/magento cache:clean
```

(\*) If you didn’t save them when you installed Magento 2, this command will ask for your Magento authentication keys (https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html).
Login = Public Key
Password = Private Key

(\*\*) With the languages option, you can define for which language you want to generate your static content. Languages should be separated with a space. 
For example, to generate content for locales en_US and fr_FR, you can run the command:
```
php bin/magento setup:static-content:deploy en_US fr_FR
```

(\*\*\*) If you are not running on production mode, use the --force option. Otherwise the command will fail.
For example, to generate content for locales en_US and fr_FR, you can run the command:

```
php bin/magento setup:static-content:deploy --force en_US fr_FR  # --force # if you are not running on production mode
```

**Troubleshooting:**

If you get a missing class error message while following the install process:

```
[ReflectionException] Class Payplug\Authentication does not exist
```

It’s likely that the Payplug PHP library was not installed along with the Magento module. This will happen if you did not run composer to install the module.
To fix it, you should require the missing dependency with composer :

```
composer require payplug/payplug-php:^3.0
```

You will then need to install another library which we use to normalize the customers' phone number
```
composer require giggsey/libphonenumber-for-php:^8.10
```

#### Cron Job Configuration

The Payplug Payments module introduces new cron tasks that are grouped under the **`payplug`** cron group in `etc/crontab.xml`. These cron jobs **must** run for the module to function properly.

- **`payplug_payments_check_order_consistency`**: Checks and updates the consistency of orders with Payplug.
- **`payplug_payments_auto_capture_deferred_payments`**: Capture the deferred payments after too much time elapsed.
- If your orders get stuck in **`payment review`** status, it typically indicates that **`payplug_payments_check_order_consistency`** is not running. Be sure to include this cron in your system’s crontab so that it is executed regularly (every 15 min by default, but you can override it to run it more frequently).

##### Verifying Crons and Logs

- Ensure your Magento crontab is correctly configured to run all Magento cron groups, including the **`payplug`** group which should be handled by default with the **`cron:run`** native command, deployed by the other native **`cron:install`** command.
- If you need to investigate any issues with these jobs, you can consult the **`var/log/payplug_payments.log`** file to see detailed logs and errors related to the Payplug Payments module’s cron executions.

For more information on how to properly configure and schedule Magento 2 cron jobs, consult
[Magento’s official documentation](https://experienceleague.adobe.com/fr/docs/commerce-operations/configuration-guide/cli/configure-cron-jobs)

For more information about the new **`payplug_payments_check_order_consistency`** cron, consult
[the Payplug CRON documentation](docs/CRONS.md)


#### Update Payplug Payments Module

Run the following commands in Magento root directory:

```
composer require --update-with-all-dependencies payplug/payplug-magento2:VERSION_YOU_WANT_TO_UPDATE_TO  # (*)
composer install
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy <languages>  # (**)
php bin/magento cache:clean
```

(\*) To determine which value for `VERSION_YOU_WANT_TO_UPDATE_TO`, you can check out our [last releases](https://github.com/payplug/payplug-magento2/releases)
For example, you can run: 
```
composer require --update-with-all-dependencies payplug/payplug-magento2:^1.5
```

(\*\*) With the languages option, you can define for which language you want to generate your static content. Languages should be separated with a space. 
For example, to generate content for locales en_US and fr_FR, you can run the command:
```
php bin/magento setup:static-content:deploy en_US fr_FR
```

## Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [4.7.1](https://github.com/payplug/payplug-magento2/releases/tag/v4.7.1) - 2026-05-18

#### ⚠ ACTION REQUIRED

This notice applies only to the WERO and BIZUM payment methods.
These payment methods are now subject to country restrictions dynamically provided by the API.

**Impact:**  
The country restrictions currently configured in Magento may no longer reflect the latest restrictions returned by the API.

**Required action:**  
Log in to your Magento Admin, navigate to Sales > Payplug Payments, and click Save Config without modifying any settings.
This will automatically synchronize the configured country restrictions with the latest restrictions provided by the API.

#### Features

- Fix incorrect loader handling and adjust onCompleted event placement (MAG-609)
- Add Satispay to no-cancel-failure support list (MAG-711)
- Send invoice email upon invoice creation (MAG-701)
- Send order confirmation email on transaction approval (paid or authorized) (MAG-708)
- Refactor PPRO methods handling for improved readability and maintainability (MAG-714)
- Fix Scalapay threshold formatting exception (MAG-705)
- Remove IPN debug mode (MAG-703)
- Fix wording on payment info block (MAG-700)
- Fix error log message during cancel and rollback operation (MAG-702)
- Update CheckOrderConsistency to check orders within a new delayed window (MAG-669)
- Make country restriction for APM available in GraphQL (MAG-671)
- Fix TypeError in Oney ViewModel currency method by casting value to float (MAG-683)
- Fix invoice status on payment when invoice is created at order placement (MAG-684)
- Use masked quote ID for public endpoints (MAG-750)
- Add MyBank to no-cancel-failure support list (MAG-756)
- Remove hardcoded countries overrides for Bizum and Wero (MAG-751)
- Update composer.json for PHP 8.5 compatibility and new SDK release (MAG-766)

**[View diff](https://github.com/payplug/payplug-magento2/compare/v4.7.0...v4.7.1)**

#### Added

- Add Satispay to no-cancel-failure support list (MAG-711) [#1976b621](https://github.com/payplug/payplug-magento2/commit/1976b6213e6ae00b72faa25442b02bb10b71ee9a)
- Send invoice email upon invoice creation (MAG-701) [#8639b315](https://github.com/payplug/payplug-magento2/commit/8639b315b282213093c8f904efd5d3ec2e514b13)
- Send order confirmation email on transaction approval (paid or authorized) (MAG-708) [#626e4d1d](https://github.com/payplug/payplug-magento2/commit/626e4d1da9e562df3b80b3e7d6b7ddab9f5c6809)
- Make country restriction for APM available in GraphQL (MAG-671) [#edcdf75b](https://github.com/payplug/payplug-magento2/commit/edcdf75b09421d056dcc571afe435c5a29ea6b9a)
- Add MyBank to no-cancel-failure support list (MAG-756) [#a949f41e](https://github.com/payplug/payplug-magento2/commit/a949f41e1fb0ae36a4d1435845c44f65d2249552)

#### Changed

_(Changelog truncated for .md surface. Full history on https://packagento.com/payplug/payplug-magento2.)_

## Recent Versions

| Version | Released |
|---|---|
| 4.7.1 | 2026-06-03 |
| 4.7.1-RC0 | 2026-05-18 |
| 4.7.0 | 2026-04-29 |
| 4.6.3 | 2026-03-12 |
| 4.6.2 | 2026-02-11 |
| 4.6.1 | 2026-01-14 |
| 4.6.0 | 2025-11-17 |
| 4.5.0 | 2025-09-03 |
| 4.3.4 | 2025-04-28 |
| 4.3.3 | 2025-04-14 |

Showing 10 of 76 versions. Full release history on https://packagento.com/payplug/payplug-magento2.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| ext-openssl | * |
| giggsey/libphonenumber-for-php | ^8.10\|^9.0 |
| magento/framework | 102.0.*\|103.0.* |
| magento/module-checkout | 100.3.*\|100.4.* |
| magento/module-payment | 100.3.*\|100.4.* |
| magento/module-sales | 102.0.*\|103.0.* |
| payplug/payplug-php | ^4.1.0 |
| php | ~8.1.0\|\|~8.2.0\|\|~8.3.0\|\|~8.4.0\|\|~8.5.0 |

## Quality

Latest release (4.7.1) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 3 | 3 warnings (ruleset: Magento2) — 1 auto-fixable with phpcbf |
| PHPMD | Warning | 109 | 109 rule violations (UnusedFormalParameter:25, CyclomaticComplexity:18, NPathComplexity:14, MissingImport:12, ExcessiveMethodLength:10) |
| Cpd | Warning | 2 | 2 duplicated chunks spanning 91 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 328 | 328 | – | – |
| 2.4.8 | – | 329 | 329 | – |
| 2.4.9 | – | – | 329 | 329 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["payplug/payplug-magento2"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

payplug is a Magento 2 vendor on Packagento. See https://packagento.com/payplug.md for their full catalogue.

