Authored by LUOXC

fixbug

... ... @@ -16,7 +16,6 @@ import com.yohobuy.ufo.model.order.req.ManualDealRequest;
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
import com.yohoufo.common.alarm.CommonAlarmEventPublisher;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.lock.RedisLock;
import com.yohoufo.common.lock.RedisLockFactory;
import com.yohoufo.common.utils.DateUtil;
... ... @@ -28,19 +27,24 @@ import com.yohoufo.order.common.HbfqEnum;
import com.yohoufo.order.common.TradeType;
import com.yohoufo.order.common.TransferCase;
import com.yohoufo.order.constants.RefundContant;
import com.yohoufo.order.model.*;
import com.yohoufo.order.model.PayQueryBo;
import com.yohoufo.order.model.PayRefundBo;
import com.yohoufo.order.model.PaymentData;
import com.yohoufo.order.model.TransferData;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.request.TransferMoneyRequest;
import com.yohoufo.order.model.response.PaymentConfirmRsp;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.mq.TopicConstants;
import com.yohoufo.order.mq.producer.TradeMqSender;
import com.yohoufo.order.service.*;
import com.yohoufo.order.service.AbstractOrderPaymentService;
import com.yohoufo.order.service.IPaymentService;
import com.yohoufo.order.service.MerchantOrderPaymentService;
import com.yohoufo.order.service.handler.BuyerOrderPayDiffTimeHandler;
import com.yohoufo.order.service.handler.payment.OrderPaymentServiceFactory;
import com.yohoufo.order.service.handler.payment.PayServiceFactory;
import com.yohoufo.order.service.handler.payment.RefundManager;
import com.yohoufo.order.service.handler.transfer.TransferChancelSelector;
import com.yohoufo.order.service.handler.payment.OrderPaymentServiceFactory;
import com.yohoufo.order.service.pay.AbstractPayService;
import com.yohoufo.order.service.pay.alipay.AlipayCrossBorderService;
import com.yohoufo.order.service.pay.alipay.AlipayOuyinService;
... ... @@ -502,7 +506,10 @@ public class PaymentServiceImpl implements IPaymentService {
throw new ServiceException(400, "不合法的金额:" + transferAmount);
}
boolean isTransferWithWallet = transferChancelSelector.isTransferWithWallet(record);
AuthorizeResultRespVO account = getOneValidAlipayAccountOr(targetUid, invalidAccount -> {
boolean notExistAlipayAccount = false;
if ("invalid".equals(invalidAccount)) {
record.setTradeStatus(YOHO_STORE_AMOUNT_WAIT_PAYMENT.getCode());
} else if ("invalid_hk".equals(invalidAccount)) {
... ... @@ -510,6 +517,10 @@ public class PaymentServiceImpl implements IPaymentService {
tradeMqSender.send(TopicConstants.HK_AMOUNT_WAIT_PAYMENT, Collections.singletonMap("uid", record.getUid()));
} else {
record.setTradeStatus(BillTradeStatus.NOT_EXIST_ALIPAY_ACCOUNT.getCode());
notExistAlipayAccount = true;
}
if (isTransferWithWallet && notExistAlipayAccount) {
return;
}
addTradeBills(record);
throw new ServiceException(400, "uid[" + targetUid + "]没有获取到有效的支付宝账号");
... ... @@ -527,7 +538,7 @@ public class PaymentServiceImpl implements IPaymentService {
try {
logger.info("{}, transfer alipayAccount={}, transferAmount={}", logTag, alipayAccount, transferAmount);
shoppingRiskWatchDog.checkManualStopTransfer();
if (transferChancelSelector.isTransferWithWallet(record)) {
if (isTransferWithWallet) {
transfer.setInterfaceType(INTERFACE_TYPE_TRANSFER_WALLET);
ordersPayTransferMapper.updateByPrimaryKeySelective(transfer);
transferWithWallet(logTag, record, buyerOrderCode, account, transferAmount, transfer);
... ...