Commit a7916ee1 authored by 李增强's avatar 李增强

Initial commit

parent 64fd7eff
...@@ -5,11 +5,11 @@ import 'package:flutter/services.dart'; ...@@ -5,11 +5,11 @@ import 'package:flutter/services.dart';
class AlipayNoUtdid { class AlipayNoUtdid {
static const MethodChannel _channel = const MethodChannel('alipay_no_utdid'); static const MethodChannel _channel = const MethodChannel('alipay_no_utdid');
static Future<_Result> pay(String order, static Future<AlipayResult> pay(String order,
{AliPayEvn payEnv = AliPayEvn.ONLINE}) async { {AliPayEvn payEnv = AliPayEvn.ONLINE}) async {
var map = await _channel var map = await _channel
.invokeMethod('pay', {"order": order, "payEnv": payEnv.index}); .invokeMethod('pay', {"order": order, "payEnv": payEnv.index});
return _Result.fromJson(map); return AlipayResult.fromJson(map);
} }
static Future<bool> isInstalled() { static Future<bool> isInstalled() {
...@@ -19,12 +19,12 @@ class AlipayNoUtdid { ...@@ -19,12 +19,12 @@ class AlipayNoUtdid {
enum AliPayEvn { ONLINE, SANDBOX } enum AliPayEvn { ONLINE, SANDBOX }
class _Result { class AlipayResult {
String msg; String msg;
String code; String code;
bool get isSuccessful => code == '9000'; bool get isSuccessful => code == '9000';
_Result.fromJson(Map map) { AlipayResult.fromJson(Map map) {
msg = map['memo']; msg = map['memo'];
code = map['resultStatus']; code = map['resultStatus'];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment