razorpay_web 1.0.1 copy "razorpay_web: ^1.0.1" to clipboard
razorpay_web: ^1.0.1 copied to clipboard

outdated

Razorpay Web Payment Gateway for Flutter

example/lib/main.dart

import 'dart:developer';

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: 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");
        },
      ),
    );
  }
}
36
likes
0
pub points
95%
popularity

Publisher

unverified uploader

Razorpay Web Payment Gateway for Flutter

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, universal_html

More

Packages that depend on razorpay_web