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

A secure Flutter plugin to integrate Zoho Checkout (Payments) using WebView. Supports success/cancel redirect detection.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Zoho Checkout Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String _message = 'Click below to start payment';

  Future<void> _startPayment() async {
    // TODO: Replace with your actual Zoho Checkout URL
    const paymentUrl = 'https://payments.zoho.com/checkout/YOUR_CHECKOUT_ID';
    const successUrl = 'https://yourwebsite.com/success';
    const cancelUrl = 'https://yourwebsite.com/cancel';

    final result = await ZohoCheckout.openCheckout(
      context,
      paymentUrl: paymentUrl,
      successUrl: successUrl,
      cancelUrl: cancelUrl,
      appBarTitle: 'Zoho Payment',
    );

    if (!mounted) return;

    if (result == true) {
      setState(() {
        _message = 'Payment Successful!';
      });
    } else if (result == false) {
      setState(() {
        _message = 'Payment Cancelled.';
      });
    } else {
      setState(() {
        _message = 'Payment Dismissed.';
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Zoho Checkout Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(_message, style: const TextStyle(fontSize: 18)),
            const SizedBox(height: 20),
            ElevatedButton(
              onPressed: _startPayment,
              child: const Text('Pay with Zoho'),
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
160
points
88
downloads

Publisher

unverified uploader

Weekly Downloads

A secure Flutter plugin to integrate Zoho Checkout (Payments) using WebView. Supports success/cancel redirect detection.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, web, webview_flutter

More

Packages that depend on flutter_zoho_checkout

Packages that implement flutter_zoho_checkout