| | |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.wechat.pay.java.service.refund.model.AmountReq; |
| | | import com.wechat.pay.java.service.refund.model.CreateRequest; |
| | | import com.wechat.pay.java.service.refund.model.QueryByOutRefundNoRequest; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | |
| | | amountReq.setCurrency("CNY"); |
| | | request.setAmount(amountReq); |
| | | try { |
| | | log.error("=============="+JSONObject.toJSONString(request)); |
| | | com.wechat.pay.java.service.refund.model.Refund response = WxMiniConfig.refundService.create(request); |
| | | log.error("=============="+JSONObject.toJSONString(response)); |
| | | if ("SUCCESS".equals(response.getStatus().name()) |
| | | || "PROCESSING".equals(response.getStatus().name()) ) { |
| | | return true; |
| | |
| | | } |
| | | |
| | | } |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public com.wechat.pay.java.service.refund.model.Refund isSuucessRefund(String outTradeNo) { |
| | | // 发送退款请求 |
| | | |
| | | QueryByOutRefundNoRequest request = new QueryByOutRefundNoRequest(); |
| | | request.setOutRefundNo(outTradeNo); |
| | | request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId()); |
| | | try { |
| | | log.error("=============="+JSONObject.toJSONString(request)); |
| | | com.wechat.pay.java.service.refund.model.Refund response = WxMiniConfig.refundService.queryByOutRefundNo(request); |
| | | log.error("=============="+JSONObject.toJSONString(response)); |
| | | if ("SUCCESS".equals(response.getStatus().name()) |
| | | || "PROCESSING".equals(response.getStatus().name()) ) { |
| | | return response; |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | public Refund wxRefundOld(RefundDTO refundDTO) { |
| | | // 发送退款请求 |
| | | String refNum = ID.nextGUID(); |