pay_service.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // import 'package:fluwx/fluwx.dart' as fluwx;
  2. // import 'package:flutter_alipay/flutter_alipay.dart';
  3. // import 'package:stripe_payment/stripe_payment.dart';
  4. // class PayService {
  5. // PayService._();
  6. // void wechatPay() async {
  7. // bool isInstalled = await fluwx.isWeChatAppInstalled();
  8. // if (isInstalled) {
  9. // fluwx
  10. // .pay(fluwx.PayInfo(
  11. // appId: 'your_app_id',
  12. // partnerId: 'your_partner_id',
  13. // prepayId: 'your_prepay_id',
  14. // packageValue: 'Sign=WXPay',
  15. // nonceStr: 'your_nonce_str',
  16. // timeStamp: 'your_timestamp',
  17. // sign: 'your_sign',
  18. // ))
  19. // .then((response) {
  20. // // 处理支付结果
  21. // });
  22. // } else {
  23. // // alert('未安装微信');
  24. // }
  25. // }
  26. // void alipay() async {
  27. // String orderString = 'your_order_string'; // 从服务器获取
  28. // var result = await FlutterAlipay.pay(orderString);
  29. // }
  30. // void stripe() async {
  31. // var token = await StripePayment.paymentRequestWithCardForm(
  32. // CardFormPaymentRequest());
  33. // // 发送 token 到服务器进行支付处理
  34. // }
  35. // }