diff --git a/lib/util/wxpay_util.dart b/lib/util/wxpay_util.dart index 9f50185..127872c 100644 --- a/lib/util/wxpay_util.dart +++ b/lib/util/wxpay_util.dart @@ -2,24 +2,36 @@ import 'package:zhiying_comm/zhiying_comm.dart'; ////微信支付简单封装 class WxPayUtil { - ////调用此方法 static Future toPay(Map params) async { - var payInfo = SyPayInfo(); - payInfo.appid = params['appid']; - payInfo.noncestr = params['noncestr']; - payInfo.package = params['package']; - payInfo.partnerid = params['partnerid']; - payInfo.sign = params['sign']; - payInfo.timestamp = params['timestamp']; - payInfo.prepayid = params['prepayid']; - print("发起微信支付"); - SyPayResult result = await SyFlutterWechat.pay(payInfo); + print(params); + var result = await payWithWeChat( + appId: params['appid'].toString(), + partnerId: params['partnerid'].toString(), + prepayId: params['prepayid'].toString(), + packageValue: params['package'].toString(), + nonceStr: params['noncestr'].toString(), + timeStamp:int.tryParse(params['timestamp']), + sign: params['sign'], + ); - if (result == SyPayResult.success) { - return true; - } else { - return false; - } + print(result); + return result; + // var payInfo = SyPayInfo(); + // payInfo.appid = params['appid']; + // payInfo.noncestr = params['noncestr']; + // payInfo.package = params['package']; + // payInfo.partnerid = params['partnerid']; + // payInfo.sign = params['sign']; + // payInfo.timestamp = params['timestamp']; + // payInfo.prepayid = params['prepayid']; + // print("发起微信支付"); + // SyPayResult result = await SyFlutterWechat.pay(payInfo); + // + // if (result == SyPayResult.success) { + // return true; + // } else { + // return false; + // } } } diff --git a/lib/zhiying_comm.dart b/lib/zhiying_comm.dart index d5369c8..1e8df24 100644 --- a/lib/zhiying_comm.dart +++ b/lib/zhiying_comm.dart @@ -44,8 +44,8 @@ export 'util/event_util/login_success_event.dart'; export 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; export 'package:save_image/save_image.dart'; export 'package:zhiying_comm/pages/login_page/login_style_util.dart'; -export 'package:sy_flutter_wechat/sy_flutter_wechat.dart'; export 'package:zhiying_comm/util/wxpay_util.dart'; export 'package:zhiying_comm/util/encode_util.dart'; export 'package:path_provider/path_provider.dart'; - +export 'package:dio/dio.dart'; +export 'package:fluwx/fluwx.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 4f17206..c4484e2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,7 +49,10 @@ dependencies: photo_view: ^0.10.3 imei_plugin: 1.2.0 # mob 分享sdk - sharesdk_plugin: ^1.2.9 + sharesdk_plugin: + git: + url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/sharesdk_plugin.git' + ref: '0.0.1' #秒验 secverify: #path: ../secverify @@ -91,7 +94,7 @@ dependencies: git: url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/tobias.git' ref: '0.0.2' - sy_flutter_wechat: '0.2.2' + fluwx: '2.6.2' event_bus: 1.1.1