Laravel 7/6 Paytm Payment Gateway Integration

In this tutorial you will learn about the Laravel 7/6 Paytm Payment Gateway Integration and its application with practical example.

In this Laravel 7/6 Paytm Payment Gateway Integration Example tutorial, I’ll show you how to integrate Paytm payment gateway in laravel 7/6. In this tutorial you will learn to integrate Paytm in laravel 7/6. In this step by step tutorial I’ll share laravel 7/6 Paytm integration example.

Paytm Payment Gateway

Paytm is one of the popular payment gateway, that allows us to accept payment from your customer. Paytm is very simple, hassle free and easy to integrate payment gateway. Integrating Paytm payment gateway in laravel 7/6 is a breeze.

Laravel 7/6 Paytm Payment Gateway Integration

In this tutorial, you will learn to integrate Paytm payment gateway in your laravel 7/6 project. Follow this step by step tutorial to learn Paytm payment gateway integration in laravel 7/6.

  • Install laravel fresh Setup
  • Configuration .env file
  • Install Anandsiddharth paytm package
  • Generate Migration and Create Model
  • Make Route
  • Create Controller
  • Create Blade View file
  • Start Development Server
  • Conclusion

Install laravel Fresh Project

First of all we need to create a fresh laravel project, download and install Laravel using the below command

Configuration in .env

Now, lets create a MySQL database and connect it with laravel application. After creating database we need to set database credential in application’s .env file.

Install Anandsiddharth paytm package

Now, we need to install Anandsiddharth paytm package in our project. Open your terminal and switch to project directory and use the following composer command to install Anandsiddharth paytm package.

After installing the package, we need to register the provider and alias. Go to the app/config/app.php and put the below lines here :

Now we need to set a paytm credential as following. Go to the app/config/services.php and set the paytm credential

Generate Migration and Create Model

Now, in this step we will create model and migration file. Please run the following command:

The above command will create a model name Event and also create a migration file for the events table. After that go to database/migrations file and put the below here :

Now, in this step we will create model and migration file. Please run the following command:

Now, add the fillable property inside the Event.php file.

Make Route

After this, we need to define routes in “routes/web.php” file. Lets open “routes/web.php” file and add the following routes in it.

routes/web.php

Create Controller

Now, lets create a controller named EventController using command given below –

Go to app/HTTP/Controller/EventController and put the below code :

Create Blade View file

Now, we need to create blade views file, Go to app/resources/views/ and create one file name event.blade.php :

Start Development Server

Now we are ready to run our example so lets start the development server using following artisan command –

Now, open the following URL in browser to see the output –

http://localhost:8000/event

Testing Card Credential

In this tutorial we have learn about the Laravel 7/6 Paytm Payment Gateway Integration and its application with practical example. I hope you will like this tutorial.