midtrans_snap 1.0.1 copy "midtrans_snap: ^1.0.1" to clipboard
midtrans_snap: ^1.0.1 copied to clipboard

Unofficial midtrans package. This package only supports the snap token flow.

Midtrans Snap #

Unofficial midtrans package. This package only supports the snap token flow.

Usage #

  1. Add midtrans_snap as a dependency in your pubspec.yaml.

    dependencies:
      midtrans_snap: latest
    
  2. Install it

      flutter pub get
    
  3. And use it

    import 'package:flutter/material.dart';
    import 'package:midtrans_snap/midtrans_snap.dart';
    import 'package:midtrans_snap/models.dart';
    
    main() => runApp(MaterialApp(
          home: Scaffold(
            body: MidtransSnap(
              mode: MidtransEnvironment.sandbox,
              token: 'SNAP_TOKEN',
              midtransClientKey: 'CLIENT_KEY',
              onPageFinished: (url) {
                print(url);
              },
              onPageStarted: (url) {
                print(url);
              },
              onResponse: (result) {
                print(result.toJson());
              },
            ),
          ),
        ));
    
4
likes
130
pub points
68%
popularity

Publisher

verified publisherariefsn.dev

Unofficial midtrans package. This package only supports the snap token flow.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, intl, toolkit, webview_flutter

More

Packages that depend on midtrans_snap