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:
Login to the OpenCart site with admin credentials.
In the left pane, you can find “Extensions”. On clicking it, you will see the dropdown
submenus of it like “Installer”, Modifications, etc.
On clicking “Installer” under “Extensions”, the new page will appear as follows. Now, click
the upload button and choose the PhonePe.ocmode.zip file.
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
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
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.
On the Checkout page, after selecting the “PhonePe” option for payment, the customer can click on the “Confirm order” button.
If you click “confirm order”, then you can see a window pop-up where you can choose the
desired option to complete the transaction.
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.
Updated over 1 year ago