Mumbai, India

dqureshiumar@gmail.com

Integrate Instamojo Payment Gateway in Laravel

Home  /  Integrate Instamojo Payment Gateway in Laravel

Integrate a free payment gateway in Laravel using simple steps

by Umar Qureshi


Instamojo is a free payment gateway that provide safe transactions through your own customized website



Steps to get your API credentials:

  1. For Test Payment Gateway visit https://test.instamojo.com
  2. For Live Payment Gateway visit https://instamojo.com
  3. Register and Login
  4. You will be redirected to Dashboard
  5. Click on API and Plugins
  6. Note the API key and Auth Token
Instamojo API Key


Start Integrating



1. Installation and Setup

  1. Now as we have our API credentials we are all set to integrate it in our Web Application
  2. You need to make sure you have composer in your machine. If not install composer
  3. After installing composer go to your Laravel project and install Instamojo API using :
    composer require instamojo/instamojo-php
  4. You will see our instamojo is succesfully installed in composer.json


  5. Composer.json Image

  6. Now, after successfully installing Instamojo-Php using composer place your API keys in the .env file that is present in your Laravel Project




  7. Note : If you are using test API keys, so you need to specify the IM_URL. If working with live keys remove the IM_URL




2. Integration with code

  1. Make a Laravel Blade Page and add a link to redirect it to the Payment URL




  2. Code :

  3. Make a Controller PayContoller. you can use the command :
    php artisan make:controller PayController
  4. Make a function that redirects you to the Payment Website


  5. Instamojo Payment Redirect Get the source code of the code here

  6. We also need to make a success URL for redirecting and error handling and if there is any data that has to be stored as a result.


  7. Instamojo Payment Successful Get the source code of the code here

  8. Paste your project data that you have to store or handle during the time of payment
  9. Get the source code of the code here

If any queries you can get back to dqureshiumar@gmail.com
Hope you liked it.
Thank You.