Magento Integration


Built on open-source technology, Magento is a highly flexible e-commerce platform that puts you in the driver’s seat. It offers a comprehensive shopping cart system and allows you to customize every aspect of your online store’s appearance, content, and functionality. The platform also includes built-in tools for marketing, SEO, and catalog management, giving you everything you need to succeed online.

📘 Magento Integration: Key Information for Merchants!


  • Our plugin supports Magento 2.x since Magento 1.x has officially reached EOL in June 2020. We highly recommend migrating to Magento 2.x for continued support and updates.
  • We support both UAT(Test) and Production modes for processing transactions.
  • The merchant order ID is now visible on the Magento dashboard, allowing you to view all transaction details.
  • We provide webhook support and the option to invoke the paypage in an iFrame or a new window.
  • We currently do not support controlling payment methods or defining custom timeout periods.

To get started with the PhonePe plugin, you will need two main components to be installed:

  • Install the PhonePe PHP SDK (V2 – 2.0.0) by following the official instructions on the PhonePe Developer Documentation.
    • Open your project’s composer.json file in your preferred editor.
    • Copy and paste the repositories and require code from the PhonePe PHP developer documentation into the corresponding sections of your composer.json file.
    • Once you have copied the code, run the composer install command in your terminal from your Magento root directory to install the PHP dependencies.
  • Download the latest release of the PhonePe plugin(1.0.0) for your e-commerce platform. To download click here.
    • Unzip the plugin file you downloaded.
    • Copy the unzipped folder into your Magento project’s app  code directory.
    • From your project’s root directory (where the bin folder is located), run the required Magento-specific commands to enable the plugin into your store.
Run this command to enable your PhonePe Payment Gateway
php bin/magento module:enable Phonepe_PG
Run these are magento specific commands
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
  • Log in to your Magento site as an administrator.
  • From the menu, go to Stores Configuration and make sure the scope is set to “Default Config.”
  • Scroll to Sales and click on Payment Methods.
  • Find the PhonePe Payment Gateway section.
  • Set “Enable” to “Yes” and enter your Client ID, Client Secret, and Client Version.
  • We have two environments: UAT (Test) and Production. To validate the payment flow, begin in the UAT (Test) environment. Once you have successfully completed the process and verified its functionality, you may then use the Production environment.

📘 Accessing Your Credentials


You can view your Client ID and Client Secret from the PhonePe Business Dashboard. Navigate to Developer Settings to find your API keys and use them to try out the sample code.

⚠️ Webhook Registration in UAT!


Webhook registration is currently not supported in UAT(Test) environment. This will not have an impact on the overall successful flow of the plugin.

  • Add an item to your cart and go to checkout. Fill in your shipping details and proceed.
  • Select PhonePe PG on the Payment page.
  • Complete the checkout to confirm the Payment is working.

That’s it! PhonePe Payment Gateway is now integrated with your Magento store, and you’re ready to start accepting payments from your customers.

If your plugin is not visible on the store, please ensure to remove the old generated files and force deploy static content.

Run these commant to remove
rm -rf pub/static/frontend                           
rm -rf var/view_preprocessed
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Is this article helpful?