1. Installation via Composer (Advised)
1.2 Update PayPlug Payments Module
2. PayPlug installation via the Magento Back-office
1. Installation via Composer (advised)
You can install the PayPlug plugin with our updated Github documentation
In order to install the PayPlug plugin on Magento 2 with Composer, you will then have to apply the following command at the Magento root:
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
1.1 Help
If you get an error message while processing the payment like this one :
[ReflectionException] Class Payplug\Authentication does not exist
The PayPlug PHP library might not have been installed with the Magento plugin installation. It can happen if you haven't installed the plugin via Composer. To fix this, you should ask for the missing dependencies 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
1.2 Update PayPlug Payments Module
To update the plugin, you will have to 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 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
2. PayPlug installation via the Magento Back-office
You can follow the Magento documentation Provided on that page:
https://devdocs.magento.com/guides/v2.3/comp-mgr/extens-man/extensman-main-pg.html
- Create your ids to access to the Magento marketplace
- Search and add to the cart the Magento 2 PayPlug plugin, you will get the authentication keys
- Connect to your Magento back-office
- Go to the "System" menu >Web Setup Wizard
- Click on "Extension Manager"
- If asked, connect to "Extension Manager"
- You will then be asked to connect with the public and private key on the Marketplace when uploading a plugin.
- Click on "Submit"
- After connecting to the PayPlug plugin you will find the screen below
- Click on the "Extensions/ Ready to Install"
3. Update payment status
3 methos are available to update payments:
- paymentReturn: automatically called by PayPlug after validating the payment form
- IPN: triggered by PayPlug after the payment form submission. Please note that to benefit from the Instant Payment Notification, your server should be accessible by PayPlug.The IPN calls will fail in most development environments.
- The "Update Payment" button on the back office order view: it asks for a request, to PayPlug, to get the current payment status
For installment payments, each time a new payment will be added, a notification will be sent to our server. Tis will trigger the modification of the amount due for the order.
4. Uninstalling the plugin
As for all payment methods, it is not advised to uninstall the payment plugins. Once the orders are created using this given means of payment, Magento will need the plugin code to display the order information, and will crash if it doesn't find them.
Thus, if you wish one day, to stop using our plugin, we recommand you simply to set up the "Enabled" setting to "No"
Going further :