instamojo_plus 0.0.1 copy "instamojo_plus: ^0.0.1" to clipboard
instamojo_plus: ^0.0.1 copied to clipboard

A Flutter package to integrate Instamojo payment gateway.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:instamojo_plus/instamojo_plus.dart';
import 'package:instamojo_plus/src/model/payment_request.dart';
import 'test_instamojo.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Instamojo Demo',
        theme: ThemeData(primarySwatch: Colors.blue),
        home: Homescreen());
  }
}

class Homescreen extends StatelessWidget {
  const Homescreen({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('Instamojo Demo'),
        ),
        body: Center(
            child: ElevatedButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) => PaymentScreen(
                              clientId: 'clientId',
                              clientsecret: 'clientsecret',
                              paymentRequest: paymentRequest,
                              onPaymentSuccess: (p0) =>
                                  print('Payment Success: $p0'),
                              onPaymentError: (p0) => print('¸ $p0'),
                              onPaymentCancel: () => print('Payment Cancelled'),
                            )

                        // PaymentScreen(
                        //   apiKey: '3aV4luprTO5nKKss9lIOJarqhJo9CVs5aohPVwwF',
                        //   authToken:
                        //       'x8Z2nUfX1qaUBbFzRH3OOXbiOETCvvkrumMz31PPpIbyLTZg650t2tuzydlmFqoZKjgN73WpEyYBqnBCsG02hjuauBFIhyd4jKM9uTpmAv95i4YMyybMZPdk9BvHmRtm',
                        //   paymentRequest: paymentRequest,
                        //   onPaymentSuccess: (p0) => print('Payment Success: $p0'),
                        //   onPaymentError: (p0) => print('Payment Error: $p0'),
                        //   onPaymentCancel: () => print('Payment Cancelled'),
                        // ),
                        ),
                  );
                },
                child: Text('Do payment'))));
  }
}

// PaymentScreen(
//         apiKey: '3aV4luprTO5nKKss9lIOJarqhJo9CVs5aohPVwwF',
//         authToken:
//             'x8Z2nUfX1qaUBbFzRH3OOXbiOETCvvkrumMz31PPpIbyLTZg650t2tuzydlmFqoZKjgN73WpEyYBqnBCsG02hjuauBFIhyd4jKM9uTpmAv95i4YMyybMZPdk9BvHmRtm',
//         paymentRequest: paymentRequest,
//         onPaymentSuccess: (p0) => print('Payment Success: $p0'),
//         onPaymentError: (p0) => print('Payment Error: $p0'),
//         onPaymentCancel: () => print('Payment Cancelled'),
//       ),
final paymentRequest = InstamojoPaymentRequest(
  purpose: ' Subscription',
  amount: double.parse('10'),
  buyerName: 'Sujith',
  email: 'sujith@gmail.com',
  phone: '7994095833',
  redirectUrl: 'http://www.example.com/redirect/',
);
1
likes
0
points
12
downloads

Publisher

verified publishersujithdev.live

Weekly Downloads

A Flutter package to integrate Instamojo payment gateway.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, url_launcher, webview_flutter

More

Packages that depend on instamojo_plus