Laravel 9 Razorpay Payment Gateway Integration Example
By Hardik Savani April 2, 2022 Category : LaravelPauseUnmuteLoaded: 1.20%FullscreenHi 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:
In this step, we need to install razorpay/razorpay composer package to use razorpay api. so let's run bellow command:
composer require razorpay/razorpay
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
<?php use Illuminate\Support\Facades\Route; use App\Http\Controllers\RazorpayPaymentController; /*|--------------------------------------------------------------------------| Web Routes|--------------------------------------------------------------------------|| Here is where you can register web routes for your application. These| routes are loaded by the RouteServiceProvider within a group which| contains the "web" middleware group. Now create something great!|*/ Route::get('razorpay-payment', [RazorpayPaymentController::class, 'index']);Route::post('razorpay-payment', [RazorpayPaymentController::class, 'store'])->name('razorpay.payment.store');
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: