Explorar o código

[modify]ios版本去掉支付宝sdk

Destiny hai 1 ano
pai
achega
ef294d2f5e
Modificáronse 3 ficheiros con 62 adicións e 63 borrados
  1. 4 4
      lib/sdk/pay/agile_pay.dart
  2. 58 58
      lib/sdk/pay/alipay/alipay.dart
  3. 0 1
      pubspec.yaml

+ 4 - 4
lib/sdk/pay/agile_pay.dart

@@ -20,9 +20,10 @@ class AgilePay {
       AgilePayBefore? before}) {
     IAgilePay? iAgilePay;
 
-    if (payInfo is AliPayInfo) {
-      iAgilePay = Alipay(payInfo);
-    } else if (payInfo is WechatPayInfo) {
+    // if (payInfo is AliPayInfo) {
+    //   iAgilePay = Alipay(payInfo);
+    // } else
+    if (payInfo is WechatPayInfo) {
       iAgilePay = WechatPay(payInfo);
     } else if (payInfo is ApplePayInfo) {
       iAgilePay = ApplePay(payInfo);
@@ -42,5 +43,4 @@ class AgilePay {
           AgilePayCode.getMessageByCode(AgilePayCode.payCodeNotSupport));
     }
   }
-
 }

+ 58 - 58
lib/sdk/pay/alipay/alipay.dart

@@ -1,58 +1,58 @@
-import 'dart:async';
-
-import 'package:flutter/widgets.dart';
-
-import '../assist/agile_pay_state_info.dart';
-import '../code/agile_pay_code.dart';
-import '../listener/i_agile_pay.dart';
-import 'ali_pay_info.dart';
-import 'package:alipay_kit/alipay_kit.dart';
-
-class Alipay extends AgilePayStateInfo implements IAgilePay {
-  final AliPayInfo _aliPayInfo;
-
-  late final StreamSubscription<AlipayResp> _paySubs;
-
-  Alipay(this._aliPayInfo) {
-    _paySubs = AlipayKitPlatform.instance.payResp().listen(_listenPay);
-  }
-
-  void _listenPay(AlipayResp resp) {
-    final String content = 'pay: ${resp.resultStatus} - ${resp.result}';
-    debugPrint('agilePay-alipay---> $content');
-    try {
-      int code = AgilePayCode.payCodeOtherError;
-      if (resp.resultStatus == AgilePayCode.payCodeAlipaySuccess) {
-        sendPaySuccess(resp.result);
-      } else {
-        if (resp.resultStatus != null &&
-            AgilePayCode.resultStatus.containsKey(resp.resultStatus)) {
-          code = resp.resultStatus!;
-        }
-        sendPayError(code, AgilePayCode.getMessageByCode(code));
-      }
-    } catch (e) {
-      sendError(AgilePayCode.payCodeOtherError,
-          AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
-    } finally {
-      dispose();
-    }
-  }
-
-  @override
-  void pay() {
-    sendPayBefore();
-    try {
-      AlipayKitPlatform.instance.pay(
-        orderInfo: _aliPayInfo.payInfo,
-      );
-    } catch (e) {
-      sendError(AgilePayCode.payCodePayError,
-          AgilePayCode.getMessageByCode(AgilePayCode.payCodePayError));
-    }
-  }
-
-  void dispose() {
-    _paySubs.cancel();
-  }
-}
+// import 'dart:async';
+
+// import 'package:flutter/widgets.dart';
+
+// import '../assist/agile_pay_state_info.dart';
+// import '../code/agile_pay_code.dart';
+// import '../listener/i_agile_pay.dart';
+// import 'ali_pay_info.dart';
+// import 'package:alipay_kit/alipay_kit.dart';
+
+// class Alipay extends AgilePayStateInfo implements IAgilePay {
+//   final AliPayInfo _aliPayInfo;
+
+//   late final StreamSubscription<AlipayResp> _paySubs;
+
+//   Alipay(this._aliPayInfo) {
+//     _paySubs = AlipayKitPlatform.instance.payResp().listen(_listenPay);
+//   }
+
+//   void _listenPay(AlipayResp resp) {
+//     final String content = 'pay: ${resp.resultStatus} - ${resp.result}';
+//     debugPrint('agilePay-alipay---> $content');
+//     try {
+//       int code = AgilePayCode.payCodeOtherError;
+//       if (resp.resultStatus == AgilePayCode.payCodeAlipaySuccess) {
+//         sendPaySuccess(resp.result);
+//       } else {
+//         if (resp.resultStatus != null &&
+//             AgilePayCode.resultStatus.containsKey(resp.resultStatus)) {
+//           code = resp.resultStatus!;
+//         }
+//         sendPayError(code, AgilePayCode.getMessageByCode(code));
+//       }
+//     } catch (e) {
+//       sendError(AgilePayCode.payCodeOtherError,
+//           AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
+//     } finally {
+//       dispose();
+//     }
+//   }
+
+//   @override
+//   void pay() {
+//     sendPayBefore();
+//     try {
+//       AlipayKitPlatform.instance.pay(
+//         orderInfo: _aliPayInfo.payInfo,
+//       );
+//     } catch (e) {
+//       sendError(AgilePayCode.payCodePayError,
+//           AgilePayCode.getMessageByCode(AgilePayCode.payCodePayError));
+//     }
+//   }
+
+//   void dispose() {
+//     _paySubs.cancel();
+//   }
+// }

+ 0 - 1
pubspec.yaml

@@ -105,7 +105,6 @@ dependencies:
     path: plugin/atmob_channel_reader
 
   #支付
-  alipay_kit: ^6.0.0
   wechat_kit: ^6.0.1
   in_app_purchase: ^3.2.0