| | |
| | | import com.github.binarywang.wxpay.service.WxPayService; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.util.IpUtil; |
| | | import com.sandu.ximon.admin.dto.YSY_AccessTokenDto; |
| | | import com.sandu.ximon.admin.dto.wxquery.WxOrderDto; |
| | | import com.sandu.ximon.admin.dto.wxquerydto.WxOrderDto; |
| | | import com.sandu.ximon.admin.pay.wxpay.UsrWxPayConfigService; |
| | | import com.sandu.ximon.dao.domain.WxConfigEntity; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | * @param outTradeNo |
| | | * @return |
| | | */ |
| | | private Object WxOrderQuery(Long poleId,String outTradeNo){ |
| | | public boolean WxOrderQuery(Long poleId,String outTradeNo){ |
| | | WxConfigEntity wxConfig = wxPayConfigService.getConfigByPoleId(poleId); |
| | | if(wxConfig==null){ |
| | | throw new BusinessException("获取微信支付配置失败"); |
| | | } |
| | | String s = HttpUtil.get(WECHAT_ORDER_QUETY_URL + outTradeNo + WECHAT_ORDER_QUETY + wxConfig.getMchId());//WxOrderDto |
| | | WxOrderDto wxOrderDto = JSON.parseObject(s, WxOrderDto.class); |
| | | if(("SUCCESS").equals(wxOrderDto.getTrade_state())){ |
| | | return true; |
| | | } |
| | | |
| | | return wxOrderDto.getTrade_state(); |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | |
| | | return sign; |
| | | } |
| | | |
| | | public WxPayOrderNotifyResult parseOrderNotifyResult(WxPayService wxPayService, String xmlData) { |
| | | public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) { |
| | | try { |
| | | return wxPayService.parseOrderNotifyResult(xmlData); |
| | | } catch (WxPayException e) { |
| | |
| | | } |
| | | } |
| | | |
| | | public WxPayRefundNotifyResult parseRefundNotifyResult(WxPayService wxPayService, String xmlData) { |
| | | public WxPayRefundNotifyResult parseRefundNotifyResult( String xmlData) { |
| | | try { |
| | | return wxPayService.parseRefundNotifyResult(xmlData); |
| | | } catch (WxPayException e) { |
| | |
| | | * @param callbackUrl |
| | | * @return |
| | | */ |
| | | public boolean refundOrder(WxPayService wxPayService, String orderId, String refundSn, Integer refundFee, String callbackUrl) { |
| | | public boolean refundOrder( String orderId, String refundSn, Integer refundFee, String callbackUrl) { |
| | | WxPayRefundRequest refundRequest = new WxPayRefundRequest(); |
| | | refundRequest.setOutTradeNo(orderId); |
| | | refundRequest.setOutRefundNo(refundSn); |
| | |
| | | /** |
| | | * 生成二维码付款 |
| | | */ |
| | | public String generateQRCodePay(WxPayService wxPayService, String body, |
| | | public String generateQRCodePay( String body, |
| | | String orderId, int totalFee, String callbackUrl) { |
| | | WxPayUnifiedOrderRequest wxPayUnifiedOrderRequest = new WxPayUnifiedOrderRequest(); |
| | | wxPayUnifiedOrderRequest.setBody(body); |