|
@@ -196,9 +196,12 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
@Override // 注意,这里不能添加事务注解,避免调用支付渠道失败时,将 PayOrderExtensionDO 回滚了
|
|
|
public PayOrderSubmitRespVO submitOrder(PayOrderSubmitReqVO reqVO, String userIp) {
|
|
|
|
|
|
+ String str = "";
|
|
|
+
|
|
|
try {
|
|
|
// int i = 0/0;
|
|
|
log.warn("[submitOrder--------->unifiedOrderResp][订单id({})000000支付开始]", reqVO.getId());
|
|
|
+ str = "支付开始";
|
|
|
|
|
|
|
|
|
// 1.1 获得 PayOrderDO ,并校验其是否存在
|
|
@@ -208,6 +211,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
PayClient client = channelService.getPayClient(channel.getId());
|
|
|
|
|
|
log.warn("[submitOrder--------->unifiedOrderResp][订单id({})1111111支付渠道校验通过]", order.getId());
|
|
|
+ str = "支付渠道校验通过";
|
|
|
|
|
|
// 2. 插入 PayOrderExtensionDO
|
|
|
String no = noRedisDAO.generate(payProperties.getOrderNoPrefix());
|
|
@@ -218,6 +222,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
orderExtensionMapper.insert(orderExtension);
|
|
|
|
|
|
log.warn("[submitOrder--------->unifiedOrderResp][订单id({})2222222支付渠道校验通过]", order.getId());
|
|
|
+ str = "222支付渠道校验通过";
|
|
|
|
|
|
// 3. 调用三方接口
|
|
|
PayOrderUnifiedReqDTO unifiedOrderReqDTO = PayOrderConvert.INSTANCE.convert2(reqVO, userIp)
|
|
@@ -231,6 +236,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
PayOrderRespDTO unifiedOrderResp = client.unifiedOrder(unifiedOrderReqDTO);
|
|
|
|
|
|
log.warn("[submitOrder--------->unifiedOrderResp][订单id({})333333支付完成,支付状态({})]", order.getId(), unifiedOrderResp.getStatus());
|
|
|
+ str = "调用三方接口";
|
|
|
|
|
|
// 4. 如果调用直接支付成功,则直接更新支付单状态为成功。例如说:付款码支付,免密支付时,就直接验证支付成功
|
|
|
if (unifiedOrderResp != null) {
|
|
@@ -246,7 +252,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
|
log.warn("如果调用直接支付成功,则直接更新支付单状态为成功。例如说:付款码支付,免密支付时,就直接验证支付成功:{}", unifiedOrderResp);
|
|
|
return PayOrderConvert.INSTANCE.convert(order, unifiedOrderResp);
|
|
|
} catch (Exception e) {
|
|
|
- ErrorCode err = new ErrorCode(1,e.getMessage());
|
|
|
+ ErrorCode err = new ErrorCode(1,e.getMessage() + "===" + str);
|
|
|
throw exception(err);
|
|
|
}
|
|
|
}
|