Will be Chosen someday as a Flutter Favorite by the Flutter Ecosystem Committee
A flutter plugin for razorpay integration for Web.
Add this in pubspec.yaml
razorpay_web:
import 'package:razorpay_web/razorpay_web.dart';
RazorpayWeb(
rzpKey: rzpKey, // Enter Your Razorpay Key Here
options: RzpOptions(
amount: 1000,
name: "Razorpay",
description: "Test Payment",
image: "https://i.imgur.com/3g7nmJC.png",
prefill: const PrefillData(
name: "Razorpay",
email: "rzp@gmail.com",
contact: "9876543210",
),
colorhex: "#FF0000",
),
onPaymentSuccess: (String paymentId) {
print("Payment Success");
log(paymentId);
},
onPaymentError: (String error) {
print("Payment Error");
},
),
}
If payment is successful onPaymentSuccess Function will contain the payment_id from razorpay.
Get Cors Url for generating order id from Cors Anywhere Github: