Skip to content
pubscout

razorpay_web

3.1.3, released 9 months ago by an unverified publisher

Flutter plugin for integrating the Razorpay payment gateway across multiple platforms.

Unverified publisher
$ flutter pub add razorpay_web
Source repository

What it does

Allows Flutter applications to accept payments using Razorpay with an event-driven flow. Supports Android, iOS, Web, Windows, Linux, and macOS platforms via native SDKs and WebViews.

AI-written summary of version 3.1.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to accept payments via Razorpay in a cross-platform Flutter application.
  • You require support for Android, iOS, Web, and desktop environments (Windows, macOS, Linux).

Skip it when

  • You need to process payments through a provider other than Razorpay.
  • You are looking for server-side payment processing code (this is strictly a client SDK wrapper).

Strengths

  • True cross-platform support covering mobile, web, and desktop.
  • Event-driven architecture for handling success, error, and external wallet responses.
  • Official Razorpay SDK integration for mobile.

Weaknesses

  • Requires platform-specific setup on Android, iOS, Web, and macOS.
  • Desktop platforms rely on InAppWebView and require a BuildContext passed to the open method.

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
5

Requires adding checkout scripts for web, minimum SDK/deployment target configuration for Android/iOS, and network client entitlements for macOS.

import 'package:flutter/material.dart';
import 'package:razorpay_web/razorpay_web.dart';

class PaymentScreen extends StatefulWidget {
  @override
  _PaymentScreenState createState() => _PaymentScreenState();
}

class _PaymentScreenState extends State<PaymentScreen> {
  late Razorpay _razorpay;

  @override
  void initState() {
    super.initState();
    _razorpay = Razorpay();
    _razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
    _razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
  }

  void openCheckout() {
    var options = {
      'key': 'rzp_test_1DP5mmOlF5G5ag',
      'amount': 100,
      'name': 'Acme Corp.',
    };
    _razorpay.open(options, context: context);
  }

  void _handlePaymentSuccess(PaymentSuccessResponse response) {}
  void _handlePaymentError(PaymentFailureResponse response) {}

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ElevatedButton(
          onPressed: openCheckout,
          child: Text('Pay Now'),
        ),
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace razorpay_web.

Works with

Packages commonly used together with razorpay_web: ones it builds on, ones built on it, and its own family.