Laravel Razorpay Payment Gateway Example

https://www.itsolutionstuff.com/post/laravel-razorpay-payment-gateway-exampleexample.html

https://www.itsolutionstuff.com/post/laravel-razorpay-payment-gateway-exampleexample.html Laravel Razorpay Payment Gateway Example

By Hardik Savani March 6, 2021 Category : LaravelPlayUnmuteLoaded: 1.15%FullscreenVDO.AINow, let's see tutorial of razorpay payment gateway integration in laravel. it's simple example of laravel razorpay pay example. Here you will learn laravel razorpay integration. I’m going to show you about razorpay integration in laravel. you will do the following things for razorpay api integration in laravel.

you can easily integrate razorpay payment gateway in laravel 6, laravel 7, laravel 8 and laravel 9 app.

razorpay payment gateway is for india. they provide lot's of option like credit card, debit card, UPI, phone pay, google pay, paytm payment option to do payment of user. so if you want to implement razorpay integration in your laravel app then you can do it by following bellow few steps. you can see bellow preview too:

Preview:

Step 1: Install Laravel

first of all we need to get fresh Laravel version application using bellow command, So open your terminal OR command prompt and run bellow command:

Step 2: Create Razorpay Account

First you need to create account on razorpay. then you can easily get account key id and key secret.

Create Account from here: www.razorpay.com.

After register successfully. you need to go bellow link and get id and secret as bellow screen shot:

Go Here: https://dashboard.razorpay.com/app/keys.

Next you can get account key id and secret and add on .env file as like bellow:

.env

Read Also: Paypal payment gateway integration in php source code example

Step 3: Install razorpay/razorpay Package

In this step, we need to install razorpay/razorpay composer package to use razorpay api. so let's run bellow command:

Step 4: Create Route

now we will create one route for calling our example, so let's add new route to web.php file as bellow:

routes/web.php

Step 5: Create Controller

in this step, we will create RazorpayPaymentController and write send sms logic, so let's add new route to web.php file as bellow:

app/Http/Controllers/RazorpayPaymentController.php

Step 6: Create Blade File

now we need to add blade file. so let's create razorpayView.blade.php file and put bellow code:

resources/views/razorpayView.blade.php

Now you can simple run bellow command and open that url:

Run Project:

Open URL:

Read Also: Laravel Blade @unless Directive Example

you can get testing card for razorpay from here: Click Here

Now you can run and check.

I hope it can help you...

Last updated

Was this helpful?