esewa 1.0.0 copy "esewa: ^1.0.0" to clipboard
esewa: ^1.0.0 copied to clipboard

A Flutter Package for eSewa Payment Gateway

Unofficial eSewa SDK for Flutter apps to pay with eSewa.

Features #

  • Pay with eSewa

Getting started #

This app depends on InAppWebView and flutter_inappwebview plugin. So, you need configure following things.

Dart sdk: ">=2.14.0 <3.0.0" Flutter: ">=3.0.0" Android: minSdkVersion 17 and add support for androidx (see AndroidX Migration to migrate an existing app) iOS: --ios-language swift, Xcode version >= 14

Usage #

Navigator.push(
    context,
    MaterialPageRoute(
    builder: (context) => PayWithEsewaScreen(
      config: EsewaConfigModel.sandbox(
        amount: 10,
        taxAmount: 0,
        successUrl: 'https://example.com/success',
        failureUrl: 'https://example.com/failure',
        productId: 'product_id',
      ),
      onSuccess: (config, refId) {
        if (kDebugMode) {
          print('Payment successful');
        }
        if (kDebugMode) {
          print('RefId: $refId');
        }
        showSnackBar(context, 'Payment successful RefId: $refId');
        },
    onFailure: (errorMessage) {
        Navigator.pop(context);
        showSnackBar(context, errorMessage);
        if (kDebugMode) {
          print('Error: $errorMessage');
        }
      },
    ),
  ),
);
1
likes
130
points
35
downloads

Publisher

verified publisheraayushbhattarai.com.np

Weekly Downloads

A Flutter Package for eSewa Payment Gateway

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_inappwebview

More

Packages that depend on esewa