flutter_h5pay 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 49

Flutter H5Pay #

pub package

A Flutter plugin for h5pay(Support WeChat and Alipay) #

Usage #

Add flutter_h5pay as a dependency in your pubspec.yaml file.

dependencies:
    flutter_h5pay: ^0.1.0
import 'package:flutter_h5pay/h5pay.dart';


//wrap you widget with H5PayWidget
//call the pay method to invoke the payment app

H5PayWidget(
          refererScheme: "www.xx.com://",
          builder: (ctx, controller) {
            return FlatButton(
                onPressed: () {
                  controller.pay(getPayUrl(), jumpPayResultCallback: (p) {
                    print("jump pay app result ->$p");
                  });
                },
                child: Text("pay"));
          },
        )


iOS #

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

Notice #

When payment completed or cancelled,on IOS, if need to return to the App,you must add target URL Types into the Info.plist file。

For Exmalpe. If you referer(申请H5支付时的授权域名) is http://www.xx.com In Android you can set this referer. In iOS you should set like this www.xx.com:\\,and add a URL Schemes of www.xx.com into the Info.plist file.Please refer to this article for more details.

0.1.0 #

  • A flutter plugin for h5pay(support WeChat and Alipay)

example/README.md

flutter_h5pay_example #

Demonstrates how to use the flutter_h5pay plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_h5pay: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_h5pay/flutter_h5pay.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
94
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Maintenance suggestions

The package description is too short. (-6 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
url_launcher ^5.0.3 5.2.7 5.4.1
webview_flutter ^0.3.15+1 0.3.17 0.3.18+1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
plugin_platform_interface 1.0.1
sky_engine 0.0.99
typed_data 1.1.6
url_launcher_platform_interface 1.0.4
vector_math 2.0.8
Dev dependencies
flutter_test