Skip to content

Latest commit

 

History

History
83 lines (59 loc) · 2.26 KB

PAYMENT_CN.md

File metadata and controls

83 lines (59 loc) · 2.26 KB

支付

调用支付方法很简单,但想成功并不简单:

payWithWeChat(
                appId: result['appid'],
                partnerId: result['partnerid'],
                prepayId: result['prepayid'],
                packageValue: result['package'],
                nonceStr: result['noncestr'],
                timeStamp: result['timestamp'],
                sign: result['sign'],
              );

iOS 支付

  • 配置URL Schemes ,内容为应用的AppID, 可以登录微信开放平台查看。编辑ios/Runner/Info.plist

    <key>CFBundleURLSchemes</key>
    <array>
      <string>wx84cxxxxxx</string>
    </array>
  • 配置LSApplicationQueriesSchemes

    image-20210523140138835

  • 使用

    await fluwx.registerWxApi(
              appId: "wx84cfexxxxxx",
              universalLink: "https://www.xxxx.cn/app/");
    
    fluwx.payWithWeChat(
      appId: result['appid'],
      partnerId: result['partnerid'],
      prepayId: result['prepayid'],
      packageValue: result['package'],
      nonceStr: result['noncestr'],
      timeStamp: result['timestamp'],
      sign: result['sign'],
    )

安卓支付

image-20210523132928727

image-20210523133551034

  • 使用

    // 注册
    await fluwx.registerWxApi(
              appId: "wx84cxxxxxx",
              universalLink: "https://www.xxxx.cn/app/");
    
    // 监听支付结果
    fluwx.weChatResponseEventHandler.listen((event) async {
      print(event.errCode);
    	// 支付成功  
      if (event.errCode == 0) {
      }
      // 关闭弹窗
    });

更多信息还查看支付文档吧.