Laravel 9 Razorpay Payment Gateway Integration Example
Laravel 9 Razorpay Payment Gateway Integration Example
By Hardik Savani April 2, 2022 Category : LaravelPauseUnmuteLoaded: 1.20%Fullscreen
Hi All,
This article will provide example of razorpay payment gateway integration in laravel 9. we will help you to give example of laravel 9 razorpay pay payment example. let’s discuss about laravel 9 razorpay integration. let’s discuss about razorpay integration in laravel 9. Follow bellow tutorial step of razorpay api integration in laravel 9.
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 9
This is optional; however, if you have not created the laravel app, then you may go ahead and execute the below 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: Laravel 9 Image Upload Example Tutorial
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
Run Laravel App:
All the required steps have been done, now you have to type the given below command and hit enter to run the Laravel app:
Now, Go to your web browser, type the given URL and view the app output:
Read Also: Laravel 9 Stripe Payment Gateway Integration Tutorial
Output:

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?