判断支付方式,调用不同url

This commit is contained in:
2025-09-08 04:35:49 +08:00
parent d0f71df231
commit bd20b78b02
2 changed files with 11 additions and 1 deletions

View File

@ -24,6 +24,8 @@ public class DataPushApi {
@Value(value = "${dataPush.refundUrl}")
private String refundUrl;
@Value(value = "${dataPush.alirefundUrl}")
private String alirefundUrl;
@Value(value = "${dataPush.pushItemUrl}")
private String pushItemUrl;
@ -125,7 +127,14 @@ public class DataPushApi {
String jsonParams = objectMapper.writeValueAsString(refundRequest);
logger.info("退款请求参数: {}", jsonParams);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> response = restTemplate.postForEntity(refundUrl, requestEntity, String.class);
logger.info("支付方式为: {}", refundSub.getPaymentMethod());
String url;
if (refundSub.getPaymentMethod().equals("WX_PAY")){
url = refundUrl;
}else {
url = alirefundUrl;
}
ResponseEntity<String> response = restTemplate.postForEntity(url, requestEntity, String.class);
// 处理退款接口响应
if (response.getStatusCode() == HttpStatus.OK) {