| | |
| | | import com.ruoyi.other.api.domain.TGoods; |
| | | import com.ruoyi.other.api.feignClient.CouponClient; |
| | | import com.ruoyi.other.api.feignClient.GoodsClient; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import com.ruoyi.payment.api.vo.NotifyV3PayDecodeRespBody; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | private AppUserAddressClient appUserAddressClient; |
| | | @Resource |
| | | private AppCouponClient appCouponClient; |
| | | |
| | | @Resource |
| | | private WxPaymentClient wxPaymentClient; |
| | | |
| | | @Resource |
| | | private AliPaymentClient aliPaymentClient; |
| | | |
| | | |
| | | |
| | |
| | | //支付方式(1=微信,2=支付宝) todo 待完善 |
| | | Integer paymentType = shoppingOrder.getPaymentType(); |
| | | if(1 == paymentType){ |
| | | |
| | | NotifyV3PayDecodeRespBody data = wxPaymentClient.queryOrderInfo(shoppingOrder.getCode()).getData(); |
| | | String trade_state = data.getTrade_state(); |
| | | if("NOTPAY".equals(trade_state) || "REVOKED".equals(trade_state) || "PAYERROR".equals(trade_state)){ |
| | | return AjaxResult.error("订单还未支付,不能操作退款"); |
| | | } |
| | | if("CLOSED".equals(trade_state)){ |
| | | return AjaxResult.error("订单支付已关闭,不能操作退款"); |
| | | } |
| | | if("USERPAYING".equals(trade_state)){ |
| | | return AjaxResult.error("订单正在支付中,不能操作退款"); |
| | | } |
| | | if("REFUND".equals(trade_state)){ |
| | | return AjaxResult.error("订单已退款,不能操作退款"); |
| | | } |
| | | } |
| | | if(2 == paymentType){ |
| | | |