Magento 2
About Magento
Magento is a web platform that allows content management for online stores, offering a flexible and scalable solution on which any eCommerce can be built.
The Openpay plugin for Magento enables you to use our supported payment methods (credit card, stores and wire transfers) within the shopping flow of your eCommerce.
Supported versions
- Magento Community Edition 2.1.1 or greater
Requirements
It is required for the server that hosts your Magento 2 store to fulfill the following:
- PHP v5.4 or greater.
- MySQL v5.0 or greater.
- Have a certificado SSL for your eCommerce, in case you wish to accept credit card payments.
Installation
For the installation of extensions in Magento 2 is necessary to execute some commands in the server terminal where our platform is hosted.
To implement the three payment methods in your store, it is necessary to install and enable each one separately.
1) Start the terminal application and navigate to your Magento 2 root folder.
2) Execute the commands to install each of the modules:
-
Credit card payment module
-
Store payment module
-
SPEI payment module
3) Enable the modules, update and clear cache of the platform to complete the installation process.
php bin/magento module:enable Openpay_Cards --clear-static-content
php bin/magento module:enable Openpay_Stores --clear-static-content
php bin/magento module:enable Openpay_Banks --clear-static-content
php bin/magento setup:upgrade
php bin/magento cache:clean
Setup
On your Openpay admin panel, identify the API credentials assigned to your merchant account. Find the credentials by clicking the cog icon on the upper right corner of the screen, then select Credenciales de API. On your Magento 2 admin panel, go to Stores -> Configuration. Click on the Sales -> Payment Methods link, on the lateral menu. Fill the Openpay section. Save your changes by clicking Save Config, on the upper right corner of the screen.
General settings
Card payments settings
Store payment settings
SPEI payment settings
Store and SPEI payment notifications
The plugin is prepared to receive payment notifications automatically, that is, without the need to configure your Openpay account or plugin. Notifications are sent to merchant when when a charge was made or when a payment reference was expired.
Important: The plugins assume that the store must reside in the root of the domain, so the webhook is created based on this url.
# Store and SPEI payment
https://[eCommerce domain]/openpay/index/webhook
Webhook verification
It is necessary to verify that the Webhooks were created correctly in Openpay.
- On your Openpay admin module, go to Options (cog icon) -> Settings.
- Locate the Webhooks section. If the webhook was configured correctly there will be a record in Verified status.
![Validation Webhook validation - Dashboard Openpay](/img/plugins/webhooks/webhook_en_setup.png)
![Magento 2 webhook Magento 2 webhook validation](/img/plugins/webhooks/webhook_en_magento2.png)