|
|
@@ -1,14 +1,6 @@
|
|
|
package com.izouma.zhumj.service;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
-import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
-import com.alipay.api.AlipayApiException;
|
|
|
-import com.alipay.api.AlipayClient;
|
|
|
-import com.alipay.api.domain.AlipayFundTransPayModel;
|
|
|
-import com.alipay.api.domain.AlipayFundTransUniTransferModel;
|
|
|
-import com.alipay.api.domain.Participant;
|
|
|
-import com.alipay.api.request.AlipayFundTransUniTransferRequest;
|
|
|
-import com.alipay.api.response.AlipayFundTransUniTransferResponse;
|
|
|
+
|
|
|
import com.github.binarywang.wxpay.bean.entpay.EntPayRequest;
|
|
|
import com.github.binarywang.wxpay.bean.entpay.EntPayResult;
|
|
|
import com.github.binarywang.wxpay.exception.WxPayException;
|
|
|
@@ -43,7 +35,7 @@ public class UserMoneyWithdrawApplyService {
|
|
|
private WxPayService wxPayService;
|
|
|
private CheckinInfoRepo checkinInfoRepo;
|
|
|
private MemberRepo memberRepo;
|
|
|
- private AlipayClient alipayClient;
|
|
|
+// private AlipayClient alipayClient;
|
|
|
|
|
|
public UserMoneyWithdrawApply apply(Long userId, WithdrawMethod method, String account, String name) {
|
|
|
User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
|
|
|
@@ -129,35 +121,35 @@ public class UserMoneyWithdrawApplyService {
|
|
|
throw new BusinessException(e.getMessage());
|
|
|
}
|
|
|
break;
|
|
|
- case ALIPAY:
|
|
|
- AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
|
|
- AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
|
|
|
- model.setOutBizNo(apply.getTradeNo());
|
|
|
- model.setTransAmount(apply.getAmount().toString());
|
|
|
- model.setProductCode("TRANS_ACCOUNT_NO_PWD");
|
|
|
- model.setBizScene("DIRECT_TRANSFER");
|
|
|
- Participant participant = new Participant();
|
|
|
- participant.setIdentity(apply.getAccount());
|
|
|
- participant.setIdentityType("ALIPAY_LOGON_ID");
|
|
|
- participant.setName(apply.getName());
|
|
|
- model.setPayeeInfo(participant);
|
|
|
- request.setBizModel(model);
|
|
|
-
|
|
|
- AlipayFundTransUniTransferResponse response = null;
|
|
|
- try {
|
|
|
- response = alipayClient.certificateExecute(request);
|
|
|
- log.info("支付宝转账返回 \n{}", JSON.parseObject(response.getBody())
|
|
|
- .toString(SerializerFeature.PrettyFormat));
|
|
|
- if (!(response.isSuccess() && "10000".equals(response.getCode()))) {
|
|
|
- throw new BusinessException(String
|
|
|
- .format("%s %s %s %s", response.getCode(), response.getMsg(),
|
|
|
- response.getSubCode(), response.getSubMsg()));
|
|
|
- }
|
|
|
- } catch (AlipayApiException e) {
|
|
|
- log.error("余额提现失败", e);
|
|
|
- throw new BusinessException(e.getMessage());
|
|
|
- }
|
|
|
- break;
|
|
|
+// case ALIPAY:
|
|
|
+// AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
|
|
+// AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
|
|
|
+// model.setOutBizNo(apply.getTradeNo());
|
|
|
+// model.setTransAmount(apply.getAmount().toString());
|
|
|
+// model.setProductCode("TRANS_ACCOUNT_NO_PWD");
|
|
|
+// model.setBizScene("DIRECT_TRANSFER");
|
|
|
+// Participant participant = new Participant();
|
|
|
+// participant.setIdentity(apply.getAccount());
|
|
|
+// participant.setIdentityType("ALIPAY_LOGON_ID");
|
|
|
+// participant.setName(apply.getName());
|
|
|
+// model.setPayeeInfo(participant);
|
|
|
+// request.setBizModel(model);
|
|
|
+//
|
|
|
+// AlipayFundTransUniTransferResponse response = null;
|
|
|
+// try {
|
|
|
+// response = alipayClient.certificateExecute(request);
|
|
|
+// log.info("支付宝转账返回 \n{}", JSON.parseObject(response.getBody())
|
|
|
+// .toString(SerializerFeature.PrettyFormat));
|
|
|
+// if (!(response.isSuccess() && "10000".equals(response.getCode()))) {
|
|
|
+// throw new BusinessException(String
|
|
|
+// .format("%s %s %s %s", response.getCode(), response.getMsg(),
|
|
|
+// response.getSubCode(), response.getSubMsg()));
|
|
|
+// }
|
|
|
+// } catch (AlipayApiException e) {
|
|
|
+// log.error("余额提现失败", e);
|
|
|
+// throw new BusinessException(e.getMessage());
|
|
|
+// }
|
|
|
+// break;
|
|
|
default:
|
|
|
throw new BusinessException("不支持此提现方式");
|
|
|
}
|