|
@@ -27,6 +27,7 @@ import com.ylx.common.config.WxPayConfig;
|
|
|
import com.ylx.common.core.domain.R;
|
|
|
import com.ylx.massage.domain.TRecharge;
|
|
|
import com.ylx.massage.enums.BillTypeEnum;
|
|
|
+import com.ylx.massage.service.RefundVoucherService;
|
|
|
import com.ylx.massage.service.TOrderService;
|
|
|
import com.ylx.massage.service.TRechargeService;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -67,6 +68,9 @@ public class PayController {
|
|
|
@Resource
|
|
|
private TOrderService orderService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private RefundVoucherService refundVoucherService;
|
|
|
+
|
|
|
String serialNo;
|
|
|
String platSerialNo;
|
|
|
|
|
@@ -351,13 +355,14 @@ public class PayController {
|
|
|
String xmlMsg = HttpKit.readData(request);
|
|
|
log.info("退款通知=" + xmlMsg);
|
|
|
Map<String, String> params = WxPayKit.xmlToMap(xmlMsg);
|
|
|
-
|
|
|
- String returnCode = params.get("return_code");
|
|
|
+ log.info("退款通知parms:{}",params);
|
|
|
+ String returnCode = params.get("event_type");
|
|
|
// 注意重复通知的情况,同一订单号可能收到多次通知,请注意一定先判断订单状态
|
|
|
- if (WxPayKit.codeIsOk(returnCode)) {
|
|
|
- String reqInfo = params.get("req_info");
|
|
|
+ if (returnCode.equals("REFUND.SUCCESS")) {
|
|
|
+ String reqInfo = params.get("resource");
|
|
|
String decryptData = WxPayKit.decryptData(reqInfo, WxPayApiConfigKit.getWxPayApiConfig().getPartnerKey());
|
|
|
log.info("退款通知解密后的数据=" + decryptData);
|
|
|
+// refundVoucherService.
|
|
|
// 更新订单信息
|
|
|
// 发送通知等
|
|
|
Map<String, String> xml = new HashMap<String, String>(2);
|