支付回调问题
This commit is contained in:
@@ -71,7 +71,8 @@ public class DistributionPayServiceImpl implements DistributionPayService {
|
|||||||
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
|
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
|
||||||
|
|
||||||
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : shopUserInfo.getId())
|
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : shopUserInfo.getId())
|
||||||
.setPayType(isRecharge ? PaymentPayTypeEnum.SourceType.DISTRIBUTION_RECHARGE : PaymentPayTypeEnum.SourceType.DISTRIBUTION )
|
.setSourceType(isRecharge ? PaymentPayTypeEnum.SourceType.DISTRIBUTION_RECHARGE : PaymentPayTypeEnum.SourceType.DISTRIBUTION )
|
||||||
|
.setPayType(PaymentPayTypeEnum.PayType.PAY)
|
||||||
.setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId())
|
.setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId())
|
||||||
.setAmount(isRecharge ? payParam.getAmount() : detail.getPayAmount());
|
.setAmount(isRecharge ? payParam.getAmount() : detail.getPayAmount());
|
||||||
orderPaymentService.save(orderPayment);
|
orderPaymentService.save(orderPayment);
|
||||||
@@ -104,7 +105,7 @@ public class DistributionPayServiceImpl implements DistributionPayService {
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, String> mchRecharge(String clientIP, MkDistributionPayDTO payParam) {
|
public Map<String, String> mchRecharge(String clientIP, MkDistributionPayDTO payParam) {
|
||||||
InitInfo initInfo = initPayment(payParam.getUserId() == null ? payParam.getShopId() : payParam.getUserId(), payParam, true);
|
InitInfo initInfo = initPayment(payParam.getUserId() == null ? payParam.getShopId() : payParam.getUserId(), payParam, true);
|
||||||
return wxService.v3Pay(initInfo.openId, payParam.getAmount(), "商户运营余额充值", initInfo.payment.getOrderNo(), initInfo.payment.getPayType());
|
return wxService.v3Pay(initInfo.openId, payParam.getAmount(), "商户运营余额充值", initInfo.payment.getOrderNo(), initInfo.payment.getSourceType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1046,7 +1046,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.FAIL);
|
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.FAIL);
|
||||||
if ("TRADE_SUCCESS".equals(czgCallBackDto.getState())) {
|
if ("TRADE_SUCCESS".equals(czgCallBackDto.getState())) {
|
||||||
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.SUCCESS);
|
payment.setPayStatus(PaymentPayTypeEnum.PayStatus.SUCCESS);
|
||||||
if (PaymentPayTypeEnum.SourceType.ORDER.equals(payment.getPayType())) {
|
if (PaymentPayTypeEnum.SourceType.ORDER.equals(payment.getSourceType())) {
|
||||||
OrderInfo orderInfo = orderInfoService.getById(payment.getSourceId());
|
OrderInfo orderInfo = orderInfoService.getById(payment.getSourceId());
|
||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
log.error("订单支付回调失败,订单不存在,支付记录Id,{}", payment.getId());
|
log.error("订单支付回调失败,订单不存在,支付记录Id,{}", payment.getId());
|
||||||
@@ -1059,8 +1059,8 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
// 分销奖励
|
// 分销奖励
|
||||||
distributionUserService.distribute(orderInfo.getId(), orderInfo.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), orderInfo.getShopId(), "order");
|
distributionUserService.distribute(orderInfo.getId(), orderInfo.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), orderInfo.getShopId(), "order");
|
||||||
}
|
}
|
||||||
else if (PaymentPayTypeEnum.SourceType.MEMBER_IN.equals(payment.getPayType()) || PaymentPayTypeEnum.SourceType.FREE.equals(payment.getPayType())) {
|
else if (PaymentPayTypeEnum.SourceType.MEMBER_IN.equals(payment.getSourceType()) || PaymentPayTypeEnum.SourceType.FREE.equals(payment.getSourceType())) {
|
||||||
boolean isFree = PaymentPayTypeEnum.SourceType.FREE.equals(payment.getPayType());
|
boolean isFree = PaymentPayTypeEnum.SourceType.FREE.equals(payment.getSourceType());
|
||||||
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
||||||
OrderInfo orderInfo = null;
|
OrderInfo orderInfo = null;
|
||||||
if (shopUser == null) {
|
if (shopUser == null) {
|
||||||
@@ -1100,7 +1100,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
shopRechargeService.recharge(payment.getShopId(), payment.getSourceId(), payment.getRelatedId(),
|
shopRechargeService.recharge(payment.getShopId(), payment.getSourceId(), payment.getRelatedId(),
|
||||||
BigDecimal.valueOf(czgCallBackDto.getAmount()).divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN), payment.getId(), payment.getPayType(), bizEnum);
|
BigDecimal.valueOf(czgCallBackDto.getAmount()).divide(BigDecimal.valueOf(100), 2, RoundingMode.DOWN), payment.getId(), payment.getSourceType(), bizEnum);
|
||||||
//充值并支付 ↓
|
//充值并支付 ↓
|
||||||
orderInfo = orderInfoService.getOne(new QueryWrapper()
|
orderInfo = orderInfoService.getOne(new QueryWrapper()
|
||||||
.eq(OrderInfo::getPayOrderId, payment.getId())
|
.eq(OrderInfo::getPayOrderId, payment.getId())
|
||||||
@@ -1161,7 +1161,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
// distributionUserService.distribute(payment.getId(), payment.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), payment.getShopId(), "recharge");
|
// distributionUserService.distribute(payment.getId(), payment.getOrderNo(), payment.getAmount(), orderInfo.getUserId(), payment.getShopId(), "recharge");
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
else if (PaymentPayTypeEnum.SourceType.MEMBER_PAY.equals(payment.getPayType())) {
|
else if (PaymentPayTypeEnum.SourceType.MEMBER_PAY.equals(payment.getSourceType())) {
|
||||||
//购买会员
|
//购买会员
|
||||||
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
||||||
memberConfigService.joinMember(payment.getShopId(), shopUser.getUserId(), payment.getRelatedId());
|
memberConfigService.joinMember(payment.getShopId(), shopUser.getUserId(), payment.getRelatedId());
|
||||||
@@ -1170,11 +1170,11 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
|
|
||||||
// 分销员开通
|
// 分销员开通
|
||||||
}
|
}
|
||||||
else if (PaymentPayTypeEnum.SourceType.DISTRIBUTION.equals(payment.getPayType())) {
|
else if (PaymentPayTypeEnum.SourceType.DISTRIBUTION.equals(payment.getSourceType())) {
|
||||||
distributionUserService.open(payment.getSourceId(), payment.getAmount(), payment.getShopId(), payment.getId());
|
distributionUserService.open(payment.getSourceId(), payment.getAmount(), payment.getShopId(), payment.getId());
|
||||||
} else if (PaymentPayTypeEnum.SourceType.POINT.equals(payment.getPayType())) {
|
} else if (PaymentPayTypeEnum.SourceType.POINT.equals(payment.getSourceType())) {
|
||||||
goodPayService.payCallBack(payment.getSourceId(), payment.getId());
|
goodPayService.payCallBack(payment.getSourceId(), payment.getId());
|
||||||
} else if (PaymentPayTypeEnum.SourceType.WARE.equals(payment.getPayType())) {
|
} else if (PaymentPayTypeEnum.SourceType.WARE.equals(payment.getSourceType())) {
|
||||||
gbOrderService.payCallBack(payment.getSourceId(), payment.getId());
|
gbOrderService.payCallBack(payment.getSourceId(), payment.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user