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

Initial commit

parent 64fd7eff
......@@ -5,11 +5,11 @@ import 'package:flutter/services.dart';
class AlipayNoUtdid {
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 {
var map = await _channel
.invokeMethod('pay', {"order": order, "payEnv": payEnv.index});
return _Result.fromJson(map);
return AlipayResult.fromJson(map);
}
static Future<bool> isInstalled() {
......@@ -19,12 +19,12 @@ class AlipayNoUtdid {
enum AliPayEvn { ONLINE, SANDBOX }
class _Result {
class AlipayResult {
String msg;
String code;
bool get isSuccessful => code == '9000';
_Result.fromJson(Map map) {
AlipayResult.fromJson(Map map) {
msg = map['memo'];
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