|  |  |  | 
|---|
|  |  |  | package com.doumee.api.business; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.doumee.config.wx.TransferDetailEntityNew; | 
|---|
|  |  |  | import com.doumee.config.wx.WxMiniConfig; | 
|---|
|  |  |  | import com.doumee.core.constants.Constants; | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/web/wxPayNotify") | 
|---|
|  |  |  | public ApiResponse wxPay_notify(HttpServletRequest request) { | 
|---|
|  |  |  | log.error("微信支付回调结果开始===========" ); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | ServletInputStream inputStream = request.getInputStream(); | 
|---|
|  |  |  | StringBuffer stringBuffer = new StringBuffer(); | 
|---|
|  |  |  | 
|---|
|  |  |  | .body(body) | 
|---|
|  |  |  | .build(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | NotificationConfig config = /*new RSAAutoCertificateConfig.Builder() | 
|---|
|  |  |  | .merchantId(WxMiniConfig.wxProperties.getMchId()) | 
|---|
|  |  |  | .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) | 
|---|
|  |  |  | .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer()) | 
|---|
|  |  |  | .apiV3Key(WxMiniConfig.wxProperties.getApiV3Key()) | 
|---|
|  |  |  | .build(); */ | 
|---|
|  |  |  | new RSAPublicKeyConfig.Builder() | 
|---|
|  |  |  | NotificationConfig config = new RSAPublicKeyConfig.Builder() | 
|---|
|  |  |  | .merchantId(WxMiniConfig.wxProperties.getMchId()) | 
|---|
|  |  |  | .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) | 
|---|
|  |  |  | .publicKeyFromPath(WxMiniConfig.wxProperties.getPubKeyPath()) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Transaction result = parser.parse(requestParam, Transaction.class); | 
|---|
|  |  |  | log.error("支付回调信息:{}"+ JSONObject.toJSONString(result)); | 
|---|
|  |  |  | //自定义订单号 | 
|---|
|  |  |  | String outTradeNo = result.getOutTradeNo(); | 
|---|
|  |  |  | //微信订单号 | 
|---|
|  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 支付失败 | 
|---|
|  |  |  | switch (result.getAttach()) { | 
|---|
|  |  |  | case "createGoodsOrder": { | 
|---|
|  |  |  | case "createOrder": { | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.error("微信支付回调结果结束===========" ); | 
|---|
|  |  |  | return ApiResponse.success("处理成功!"); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|