Skip to content

Razorpay payment gateway integration with Laravel, Inertia, React and Typescript

Notifications You must be signed in to change notification settings

anburocky3/Laravel-Razorpay-Inertia

Repository files navigation

Laravel Razorpay Integration with Inertia, React and Typescript.

  1. Install Razorpay SDK:
composer require razorpay/razorpay
  1. Create Model, Controller, Migration, Service, etc.
  2. Update your .env with the following values.
# Razorpay
RAZORPAY_KEY=
RAZORPAY_SECRET=
  1. Open config/services.php and add the below at the end of the array.
    'razorpay' => [
        'key' => env('RAZORPAY_KEY', ''),
        'secret' => env('RAZORPAY_SECRET', ''),
    ],
  1. Have your routes like this.
    // Payment
    Route::post('/create-order', [PaymentController::class, 'createOrder']);
    Route::post('/verify-payment', [PaymentController::class, 'verifyPayment']);

Author:

Sponsor this project