Flutter H5Pay

pub package

A Flutter plugin for h5pay(Support WeChat and Alipay)


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

    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

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


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.


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.