As we know that paytm is fastest growing plateform to provies payment services. So here i will let you know how to integrate paytm payment gateway in laravel with an example.

Paytm provides digital payment methods and boomed after digital india movement. Most of the marchant accepts paytm payment.

Here, in this example we will use a laravel package (“anandsiddharth/laravel-paytm-wallet”) to integrate paytm payment gateway in our laravel application.

So let’s start paytm integration process in our laravel application from scratch. You will need to just follow the steps as mentioned in this tutorial.

Step 1: Install laravel

In this first step, we will create a fresh laravel application using the following command. If you don’t want to install new application you can also integrate into your existing application. You can jump directly to the next step otherwise just open your terminal and run the command as given below.

composer create-project --prefer-dist laravel/laravel test-app

Step 2: Install Package

For installing the desired package, you will just need to run the following composer command in your terminal. It will automatically dowload all the files required for this package in your application.

composer require anandsiddharth/laravel-paytm-wallet

After running the above command, you will need to setup some configurations for this package. So open config/app.php file and add provider and alias as given as under.

config/app.php

'providers' => [

  ....

  Anand\LaravelPaytmWallet\PaytmWalletServiceProvider::class,

],

'aliases' => [

  ....

  'PaytmWallet' => Anand\LaravelPaytmWallet\Facades\PaytmWallet::class,

],

Now we will need to add some other configuration like marchant id and key. So open config/services.php file and add the line of code as mentaioned below.

config/services.php

<?php

return [

    ......
    'paytm-wallet' => [
        'env' => 'local', // values : (local | production)
        'merchant_id' => env('YOUR_MERCHANT_ID'),
        'merchant_key' => env('YOUR_MERCHANT_KEY'),
        'merchant_website' => env('YOUR_WEBSITE'),
        'channel' => env('YOUR_CHANNEL'),
        'industry_type' => env('YOUR_INDUSTRY_TYPE'),
    ],

];

Now add these secret key date in the application’s environment file like below.

YOUR_MERCHANT_ID=DIY12XXXXXXXXXXXXXXXX
YOUR_MERCHANT_KEY=bKXXXXXXXXXXX

YOUR_WEBSITE=XXXXXXXXX

YOUR_CHANNEL=WEB

YOUR_INDUSTRY_TYPE=Retail

#laravel #integrate paytm in laravel #integration paytm gateway laravel example #laravel paytm integration #paytm gateway in laravel #paytm payment gateway

How to integrate paytm payment gateway in laravel example
30.75 GEEK