OpenCart Plugin


We want to install and configure the PhonePe plugin in the Opencart environment which is
developed in PHP language and we have also used some functionality of curl in order to call the
“/pg/v1/pay” API through HTTP requests

Note: We will first share the test credentials with the merchant so that they can perform the
transactions in the test environment. For this, the merchant needs to select “PreProd Environment”
in the “settings” option and the merchant can pay using the PhonePe PreProd app. After checking
all the scenarios, we will give sign-off to the merchant and the merchant can go live with the prod


Download OpenCart Plugin

Download the OpenCart plugin from the market place:

Configuration of Plugin in Opencart

Step 1

Login to the OpenCart site with admin credentials.


Step 2

In the left pane, you can find “Extensions”. On clicking it, you will see the dropdown
submenus of it like “Installer”, Modifications, etc.


Step 3

On clicking “Installer” under “Extensions”, the new page will appear as follows. Now, click
the upload button and choose the file.


Step 4

Now, click the “Modification” menu in the left pane under the main menu “Extensions” and
you will see the following page. Choose “Payments” as an extension type and you will see the list of
payment options.


Step 5

As this page appears after choosing the extension type, scroll down to find the “PhonePe”
option. There, you will see two buttons “Edit” and “Install”. Click on the “Install” button to install this


Step 6

After installation, click on the ”Edit” button and the following configuration page will appear.
Fill out the following form and enable the plugin and then save this configuration. As this gets enabled,
you can see the “PhonePe” Payment option on the checkout page.



The above details will be saved and protected at the webserver of Opencart so Merchant does
not need to worry about the production credentials.

Step 7

On the Checkout page, after selecting the “PhonePe” option for payment, the customer can click on the “Confirm order” button.

1938 1984

Step 8

If you click “confirm order”, then you can see a window pop-up where you can choose the
desired option to complete the transaction.

2022 2034

Step 9

In the back-end, we will call the Check Status API in order to know whether the payment
was successful. If the payment is successful, you will be redirected to the success page.