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

PlatformAndroidiOS
outdated

A Flutter plugin for payment checkout on Klump gateway. Completely supports Android and iOS.

example/lib/main.dart

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

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: FirstScreen(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Klump Checkout Sample'),
        centerTitle: false,
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () async {
            KlumpWidget klumpWidget = KlumpWidget(
                publicKey:
                    'klp_pk_test_e4aaa1a8e96644ad9af23fa453ddd6ffa39a8233a88c4b93860f119c8cd9a332');
            final res = await klumpWidget.checkout(
              context: context,
              data: const KlumpCheckoutData(
                amount: 45000,
                shippingFee: 5000,
                merchantReference: "what-ever-you-want-this-to-be",
                metaData: {
                  'customer': "Elon Musk",
                  'email': "musk@spacex.com",
                },
                items: [
                  KlumpCheckoutItem(
                    imageUrl:
                        'https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg',
                    itemUrl: 'https://www.paypal.com/in/webapps/mpp/home',
                    name: 'Awesome item',
                    unitPrice: 20000,
                    quantity: 2,
                  )
                ],
              ),
            );
            // ignore: avoid_print
            print(res);
          },
          child: const Text('Text Checkout'),
        ),
      ),
    );
  }
}
3
likes
140
pub points
39%
popularity

Publisher

unverified uploader

A Flutter plugin for payment checkout on Klump gateway. Completely supports Android and iOS.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

equatable, flutter, flutter_webview_pro, logger

More

Packages that depend on klump_checkout