quick_payment 1.4.0 copy "quick_payment: ^1.4.0" to clipboard
quick_payment: ^1.4.0 copied to clipboard

Flutter SDK for accepting Bangladeshi manual mobile banking payments like bKash, Nagad, Rocket, and Upay.

example/lib/main.dart

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

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

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

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Quick Payment Example")),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            // Customer Details
            final customer = CustomerDetails(
              fullName: 'Khalid LikhOn',
              email: 'hello@khalidlikhon.me',
            );

            // Payment Credentials & Methods
            final credentials = QuickPayCredentials(
              feePercentage: 1.8,
              methods: [
                PaymentMethod.bkash("016xxxxxxxx"),
                PaymentMethod.nagad("017xxxxxxxx"),
                PaymentMethod.rocket("018xxxxxxxx"),
                // PaymentMethod.upay("019xxxxxxxx"), // optional
              ],
            );

            // Optional Support Credentials
            final support = QuickPaySupportCredentials(
              phoneNumber: '+880123456789',      // Optional
              email: 'hello@khalidlikhon.me',    // Required
              ticketUrl: 'https://khalidlikhon.me', // Optional
            );

            // Trigger Payment Flow
            QuickPay.createPayment(
              context: context,
              amount: 200,
              customer: customer,
              credentials: credentials,
              supportCredentials: support, // Optional
              onPaymentSubmitted: (data) {
                print(data.toMap());
              },
            );
          },
          child: const Text("Pay Now"),
        ),
      ),
    );
  }
}
7
likes
120
points
147
downloads

Documentation

API reference

Publisher

verified publisherkhalidlikhon.me

Weekly Downloads

Flutter SDK for accepting Bangladeshi manual mobile banking payments like bKash, Nagad, Rocket, and Upay.

License

MIT (license)

Dependencies

cupertino_icons, flutter, package_info_plus, url_launcher

More

Packages that depend on quick_payment