|
|
|
@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.ynxbd.common.action.base.BaseAction; |
|
|
|
import com.ynxbd.common.action.base.BaseAction; |
|
|
|
import com.ynxbd.common.bean.enums.MerchantEnum; |
|
|
|
import com.ynxbd.common.bean.enums.MerchantEnum; |
|
|
|
import com.ynxbd.common.bean.pay.ApiPayNotify; |
|
|
|
import com.ynxbd.common.bean.pay.ApiPayNotify; |
|
|
|
import com.ynxbd.common.bean.pay.Order; |
|
|
|
|
|
|
|
import com.ynxbd.common.bean.pay.ReqOrder; |
|
|
|
import com.ynxbd.common.bean.pay.ReqOrder; |
|
|
|
import com.ynxbd.common.helper.common.HttpHelper; |
|
|
|
import com.ynxbd.common.helper.common.HttpHelper; |
|
|
|
import com.ynxbd.common.helper.common.JsonHelper; |
|
|
|
import com.ynxbd.common.helper.common.JsonHelper; |
|
|
|
@ -12,17 +11,10 @@ import com.ynxbd.common.result.Result; |
|
|
|
import com.ynxbd.common.result.ResultEnum; |
|
|
|
import com.ynxbd.common.result.ResultEnum; |
|
|
|
import com.ynxbd.common.result.ServiceException; |
|
|
|
import com.ynxbd.common.result.ServiceException; |
|
|
|
import com.ynxbd.common.service.PayService; |
|
|
|
import com.ynxbd.common.service.PayService; |
|
|
|
import com.ynxbd.common.service.RegService; |
|
|
|
|
|
|
|
import com.ynxbd.common.service.RxService; |
|
|
|
|
|
|
|
import com.ynxbd.jy.bean.JYOrder; |
|
|
|
|
|
|
|
import com.ynxbd.jy.bean.JYPayNotify; |
|
|
|
|
|
|
|
import com.ynxbd.jy.bean.JYPayRSAUtil; |
|
|
|
import com.ynxbd.jy.bean.JYPayRSAUtil; |
|
|
|
import com.ynxbd.jy.bean.enums.JYBusinessTypeEnum; |
|
|
|
|
|
|
|
import com.ynxbd.jy.bean.enums.JYOrderTypeEnum; |
|
|
|
|
|
|
|
import com.ynxbd.jy.helper.JYPayConfig; |
|
|
|
import com.ynxbd.jy.helper.JYPayConfig; |
|
|
|
import com.ynxbd.jy.helper.JYPayHelper; |
|
|
|
import com.ynxbd.jy.helper.JYPayHelper; |
|
|
|
import com.ynxbd.wx.wxfactory.WxPayHelper; |
|
|
|
import com.ynxbd.wx.wxfactory.utils.WxNotifyResp; |
|
|
|
import com.ynxbd.wx.wxfactory.utils.WxRespHelper; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.apache.struts2.convention.annotation.Action; |
|
|
|
import org.apache.struts2.convention.annotation.Action; |
|
|
|
@ -114,10 +106,11 @@ public class JYPayAction extends BaseAction { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Action("notify") |
|
|
|
@Action("notify") |
|
|
|
public Result notify(String notifyType) { |
|
|
|
public Result notify(String notifyType) { |
|
|
|
|
|
|
|
WxNotifyResp notify = new WxNotifyResp(MerchantEnum.JY); |
|
|
|
try { |
|
|
|
try { |
|
|
|
PEnum pEnum = PEnum.findEnum(notifyType); |
|
|
|
PEnum pEnum = PEnum.findEnum(notifyType); |
|
|
|
if (pEnum == null) { |
|
|
|
if (pEnum == null) { |
|
|
|
return Result.respXml(WxRespHelper.respOk()); |
|
|
|
return Result.respXml(notify.respOk()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> params = reqParamsToMap(); |
|
|
|
Map<String, String> params = reqParamsToMap(); |
|
|
|
@ -129,15 +122,15 @@ public class JYPayAction extends BaseAction { |
|
|
|
ApiPayNotify info = JYPayHelper.jyPayNotify(params, notifyType); |
|
|
|
ApiPayNotify info = JYPayHelper.jyPayNotify(params, notifyType); |
|
|
|
|
|
|
|
|
|
|
|
log.info("【京颐】[{}]收到[{}]通知-{}", pEnum.NAME, (info.isRefundOrder() ? "退款" : "支付"), JsonHelper.toJsonString(info)); |
|
|
|
log.info("【京颐】[{}]收到[{}]通知-{}", pEnum.NAME, (info.isRefundOrder() ? "退款" : "支付"), JsonHelper.toJsonString(info)); |
|
|
|
Result.respXml(WxRespHelper.respOk()); // 收到请求-解析成功
|
|
|
|
Result.respXml(notify.respOk()); // 收到请求-解析成功
|
|
|
|
|
|
|
|
|
|
|
|
if (info.isRefundOrder()) { |
|
|
|
if (info.isRefundOrder()) { |
|
|
|
PayService.refundNotify(info); |
|
|
|
PayService.refundNotify(info); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
PayService.wxNotify(info); |
|
|
|
PayService.wxNotify(notify.merchantEnum, info); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (ServiceException e) { |
|
|
|
} catch (ServiceException e) { |
|
|
|
Result.respXml(WxRespHelper.resp(e)); // 收到请求-解析失败
|
|
|
|
Result.respXml(notify.resp(e)); // 收到请求-解析失败
|
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|