提交 876a33c5 authored 作者: JarvanMo's avatar JarvanMo

remove WeChatPayModel

上级 49ff4858
...@@ -46,7 +46,6 @@ class _PayPageState extends State<PayPage> { ...@@ -46,7 +46,6 @@ class _PayPageState extends State<PayPage> {
print(result['appid']); print(result['appid']);
print(result["timestamp"]); print(result["timestamp"]);
fluwx.pay( fluwx.pay(
fluwx.WeChatPayModel(
appId: result['appid'].toString(), appId: result['appid'].toString(),
partnerId: result['partnerid'].toString(), partnerId: result['partnerid'].toString(),
prepayId: result['prepayid'].toString(), prepayId: result['prepayid'].toString(),
...@@ -54,7 +53,6 @@ class _PayPageState extends State<PayPage> { ...@@ -54,7 +53,6 @@ class _PayPageState extends State<PayPage> {
nonceStr: result['noncestr'].toString(), nonceStr: result['noncestr'].toString(),
timeStamp: result['timestamp'], timeStamp: result['timestamp'],
sign: result['sign'].toString(), sign: result['sign'].toString(),
),
) )
.then((data) { .then((data) {
print("---》$data"); print("---》$data");
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
library fluwx; library fluwx;
export 'src/fluwx_class.dart'; export 'src/fluwx_class.dart';
export 'src/models/wechat_pay_model.dart';
export 'src/models/wechat_response.dart'; export 'src/models/wechat_response.dart';
export 'src/models/wechat_send_auth_model.dart'; export 'src/models/wechat_send_auth_model.dart';
export 'src/models/wechat_share_models.dart'; export 'src/models/wechat_share_models.dart';
......
...@@ -17,10 +17,10 @@ import 'dart:async'; ...@@ -17,10 +17,10 @@ import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'models/wechat_pay_model.dart';
import 'models/wechat_response.dart'; import 'models/wechat_response.dart';
import 'models/wechat_send_auth_model.dart'; import 'models/wechat_send_auth_model.dart';
import 'models/wechat_share_models.dart'; import 'models/wechat_share_models.dart';
import 'package:flutter/foundation.dart';
StreamController<WeChatShareResponse> _responseShareController = StreamController<WeChatShareResponse> _responseShareController =
new StreamController.broadcast(); new StreamController.broadcast();
...@@ -125,6 +125,26 @@ Future isWeChatInstalled() async { ...@@ -125,6 +125,26 @@ Future isWeChatInstalled() async {
return await _channel.invokeMethod("isWeChatInstalled"); return await _channel.invokeMethod("isWeChatInstalled");
} }
Future pay(WeChatPayModel model) async {
return await _channel.invokeMethod("pay", model.toMap());
Future pay({@required String appId,
@required String partnerId,
@required String prepayId,
@required String packageValue,
@required String nonceStr,
@required int timeStamp,
@required String sign,
String signType,
String extData}) async {
return await _channel.invokeMethod("pay",{
"appId": appId,
"partnerId": partnerId,
"prepayId": prepayId,
"packageValue": packageValue,
"nonceStr": nonceStr,
"timeStamp": timeStamp,
"sign": sign,
"signType": signType,
"extData": extData,
});
} }
/*
* Copyright (C) 2018 The OpenFlutter Organization
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 'package:flutter/foundation.dart';
class WeChatPayModel {
final String appId;
final String partnerId;
final String prepayId;
final String packageValue;
final String nonceStr;
final int timeStamp;
final String sign;
final String signType;
final String extData;
WeChatPayModel(
{@required this.appId,
@required this.partnerId,
@required this.prepayId,
@required this.packageValue,
@required this.nonceStr,
@required this.timeStamp,
@required this.sign,
this.signType,
this.extData});
Map toMap() {
return {
"appId": appId,
"partnerId": partnerId,
"prepayId": prepayId,
"packageValue": packageValue,
"nonceStr": nonceStr,
"timeStamp": timeStamp,
"sign": sign,
"signType": signType,
"extData": extData,
};
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论