|
1234567891011121314151617181920212223 |
- import 'package:tobias/tobias.dart' as tobias;
-
- ///支付宝支付
- class AliPayUtil {
- ///orderCode 为后端返回支付Code字符串
- ///返回true表示支付成功,false表示支付失败
- static Future<bool> toPay(String orderCode) async {
- Map<dynamic, dynamic> result = await tobias.aliPay(orderCode);
- print(result);
- if (result != null && result['resultStatus'] != null && result['resultStatus'].toString() == "9000") {
- print("支付宝支付结果");
- print(result);
- return true;
- } else {
- return false;
- }
- }
-
- ///检查是否安装了支付宝
- static Future<bool> isInstallAliPay() async {
- return await tobias.isAliPayInstalled();
- }
- }
|