| | |
| | | import com.tourguide.common.exception.BusinessException; |
| | | import com.tourguide.common.huifu.RequestSeqUtil; |
| | | import com.tourguide.modules.order.domain.OrderStatus; |
| | | import com.tourguide.modules.order.domain.PaymentMethod; |
| | | import com.tourguide.modules.order.entity.TourOrder; |
| | | import com.tourguide.modules.order.entity.TourOrderPaymentAttempt; |
| | | import com.tourguide.modules.order.mapper.TourOrderMapper; |
| | |
| | | attempt.setStatus(ATTEMPT_CREATED); |
| | | paymentAttemptMapper.insert(attempt); |
| | | |
| | | order.setPaymentMethod("WECHAT"); |
| | | order.setPaymentMethod(PaymentMethod.WECHAT.getCode()); |
| | | order.setPaymentOrderNo(reqSeqId); |
| | | orderMapper.updateById(order); |
| | | |
| | |
| | | if (!OrderStatus.PENDING_PAYMENT.matches(order.getStatus())) { |
| | | throw new BusinessException(409, "订单状态不允许确认支付"); |
| | | } |
| | | order.setPaymentMethod("WECHAT"); |
| | | order.setPaymentMethod(PaymentMethod.WECHAT.getCode()); |
| | | order.setPaymentOrderNo(notice.getReqSeqId()); |
| | | order.setPaymentAmount(notice.getAmount()); |
| | | order.setPaymentTime(paidAt); |