flutter_khalti 0.3.0+2 copy "flutter_khalti: ^0.3.0+2" to clipboard
flutter_khalti: ^0.3.0+2 copied to clipboard

discontinuedreplaced by: khalti_flutter
outdated

A fluter plugin to process khalti payment

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_khalti/flutter_khalti.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

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

  _payViaKhalti() {
    FlutterKhalti(
      urlSchemeIOS: "KhaltiPayFlutterExampleScheme",
      publicKey: "test_public_key_eacadfb91994475d8bebfa577b0bca68",
      productId: "1233",
      productName: "Test 2",
      amount: 12121,
      customData: {
        "test": "asass",
      },
    ).initPayment(
      onSuccess: (data) {
        print("success");
        print(data);
      },
      onError: (error) {
        print("error");
        print(error);
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: FlatButton(
            child: Text("Pay via khalti"),
            onPressed: () {
              _payViaKhalti();
            },
          ),
        ),
      ),
    );
  }
}
11
likes
30
pub points
49%
popularity

Publisher

unverified uploader

A fluter plugin to process khalti payment

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_khalti