提交代码

master
胡锐 6 months ago
parent 10e05a5ec1
commit aa5b369a96
  1. 15
      service/src/main/java/com/hfkj/service/pay/HuiPayService.java

@ -97,19 +97,24 @@ public class HuiPayService {
*/
public static JSONObject refund(String merNo,String merKey,String outTradeNo,String refundTradeNo, BigDecimal refundAmount) {
try {
log.info("=============== start 惠支付退款 start ==================");
Map<String,Object> param = new HashMap<>();
param.put("merchantNo", merNo);
param.put("outTradeNo", outTradeNo);
param.put("refundTradeNo", refundTradeNo);
param.put("refundAmount", refundAmount);
param.put("sign" , SignatureUtil.createSign(param, merKey));
return HttpsUtils.doPost(REQUEST_URL + "trade/refund", param, new HashMap<>());
} catch (Exception e) {
log.info("请求地址:" + (REQUEST_URL + "trade/preorder"));
log.info("请求参数:" + JSONObject.toJSONString(param));
JSONObject response = HttpsUtils.doPost(REQUEST_URL + "trade/refund", param, new HashMap<>());
log.info("响应参数:" + response.toJSONString());
return response;
} catch (Exception e) {
log.info("出现异常"+ e.getMessage());
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款异常");
} finally {
log.info("=============== end 惠支付退款 end ==================");
}
}
}

Loading…
Cancel
Save