|
@@ -16,7 +16,6 @@ import com.yami.shop.wx.config.CombinePayUrlEnum;
|
|
|
import com.yami.shop.wx.config.WechatPayServiceConfig;
|
|
|
import com.yami.shop.wx.po.JsapiPayInfoPo;
|
|
|
import com.yami.shop.wx.service.WxProviderService;
|
|
|
-import com.yami.shop.wx.utils.CullenUtils;
|
|
|
import com.yami.shop.wx.utils.OrderUtils;
|
|
|
import com.yami.shop.wx.utils.WechatPayValidator;
|
|
|
import lombok.SneakyThrows;
|
|
@@ -368,13 +367,10 @@ public class WxProviderServiceImpl implements WxProviderService {
|
|
|
@Override
|
|
|
public PayInfoBo notifyParse(HttpServletRequest request, HttpServletResponse response) {
|
|
|
JSONObject bodyJson = getNotifyBodyJson(request);
|
|
|
- CullenUtils.validateDataThrowException(bodyJson == null, "回调通知验签失败...");
|
|
|
PayInfoBo bo = new PayInfoBo();
|
|
|
-
|
|
|
if (lock.tryLock()) {
|
|
|
try {
|
|
|
// 解密resource中的通知数据
|
|
|
- assert bodyJson != null;
|
|
|
String resource = bodyJson.getString("resource");
|
|
|
JSONObject resourceJson = WechatPayValidator.decryptFromResource(resource, wechatPayServiceConfig.getApiV3Key());
|
|
|
System.out.println("=================== 服务商小程序支付回调解密resource中的通知数据 ===================\n" + resource);
|
|
@@ -402,7 +398,7 @@ public class WxProviderServiceImpl implements WxProviderService {
|
|
|
WechatPayValidator wechatPayValidator = new WechatPayValidator(getVerifier(), jsonObject.getString("id"), body);
|
|
|
if (!wechatPayValidator.validate(request)) {
|
|
|
log.error("通知验签失败");
|
|
|
- throw new GlobalException("通知验签失败");
|
|
|
+ throw new GlobalException("回调通知验签失败...");
|
|
|
}
|
|
|
log.info("通知验签成功");
|
|
|
return jsonObject;
|