Discuz!NT|BBS|论坛

注册

 

发新话题 回复该主题

ssss [复制链接]

1#
  _register() async {
    bool result = await SyFlutterWechat.register('wx94f8d9a9785f5f8e');

    if(result) {
      ToastUtil.show("注册成功");
    }
    else
      {
        ToastUtil.show("注册失败");
      }
  }


                  String payInfo = '{"appid":' + wx_appid  + ',"partnerid":' + wx_partnerid + ',"prepayid":' + wx_prepayid + ',"package":"Sign=WXPay","noncestr":' + wx_noncestr + ',"timestamp":' + wx_timestamp + ',"sign":' + wx_sign + '}';


                  SyPayResult payResult = await SyFlutterWechat.pay(SyPayInfo.fromJson(json.decode(payInfo)));
                  switch (payResult) {
                      case SyPayResult.success:
                      //付款成功

                      break;
                      case SyPayResult.cancel:
                      //用户取消支付
                      break;
                      case SyPayResult.fail:
                      //发生错误,可能的原因:签名错误、未注册APPID、项目设置APPID不正确、注册的APPID与设置的不匹配、其他异常等。
                      break;
                  }
分享 转发
TOP
发新话题 回复该主题