基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 line
671 B

  1. import 'package:tobias/tobias.dart' as tobias;
  2. ///支付宝支付
  3. class AliPayUtil{
  4. ///orderCode 为后端返回支付Code字符串
  5. ///返回true表示支付成功,false表示支付失败
  6. static Future<bool> toPay(String orderCode)async{
  7. Map<dynamic,dynamic> result= await tobias.aliPay(orderCode);
  8. print(result);
  9. if(result!=null&&result['resultStatus']!=null&&result['resultStatus'].toString()=="9000"){
  10. print("支付宝支付结果");
  11. print(result);
  12. return true;
  13. }else{
  14. return false;
  15. }
  16. }
  17. ///检查是否安装了支付宝
  18. static Future<bool> isInstallAliPay() async {
  19. return await tobias.isAliPayInstalled();
  20. }
  21. }