razorpay_web
3.1.3, released 9 months ago by an unverified publisher
Flutter plugin for integrating the Razorpay payment gateway across multiple platforms.
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.
- razorpay_flutter
Flutter plugin for the Razorpay payment gateway SDK.
86Compare - razorpay_flutter_customui
Flutter plugin for the Razorpay Custom UI SDK on Android and iOS
75Compare - adapty_flutter
Framework for implementing in-app purchases and subscriptions in Flutter apps.
92Compare - fluwx
Implements WeChat SDKs in Flutter for sharing, payment, and mini programs.
90Compare
Works with
Packages commonly used together with razorpay_web: ones it builds on, ones built on it, and its own family.
- webrazorpay_web depends on itLightweight bindings for browser APIs via JS interop
- package_info_plusrazorpay_web depends on itFlutter plugin to query app package info like version, build number and installer store.
- universal_platformrazorpay_web depends on itPlatform detection across Flutter, Dart web, and desktop without errors
- flutter_inappwebviewrazorpay_web depends on itAdd inline WebViews, headless WebViews, and in-app browser windows.
- eventifyrazorpay_web depends on itA cancellable event emitter supporting context-based event-driven programming in Dart.