|
|
@ -97,19 +97,24 @@ public class HuiPayService { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static JSONObject refund(String merNo,String merKey,String outTradeNo,String refundTradeNo, BigDecimal refundAmount) { |
|
|
|
public static JSONObject refund(String merNo,String merKey,String outTradeNo,String refundTradeNo, BigDecimal refundAmount) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
log.info("=============== start 惠支付退款 start =================="); |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
param.put("merchantNo", merNo); |
|
|
|
param.put("merchantNo", merNo); |
|
|
|
param.put("outTradeNo", outTradeNo); |
|
|
|
param.put("outTradeNo", outTradeNo); |
|
|
|
param.put("refundTradeNo", refundTradeNo); |
|
|
|
param.put("refundTradeNo", refundTradeNo); |
|
|
|
param.put("refundAmount", refundAmount); |
|
|
|
param.put("refundAmount", refundAmount); |
|
|
|
param.put("sign" , SignatureUtil.createSign(param, merKey)); |
|
|
|
param.put("sign" , SignatureUtil.createSign(param, merKey)); |
|
|
|
return HttpsUtils.doPost(REQUEST_URL + "trade/refund", param, new HashMap<>()); |
|
|
|
log.info("请求地址:" + (REQUEST_URL + "trade/preorder")); |
|
|
|
} catch (Exception e) { |
|
|
|
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 { |
|
|
|
} finally { |
|
|
|
|
|
|
|
log.info("=============== end 惠支付退款 end =================="); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|