判断支付方式,调用不同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}") @Value(value = "${dataPush.refundUrl}")
private String refundUrl; private String refundUrl;
@Value(value = "${dataPush.alirefundUrl}")
private String alirefundUrl;
@Value(value = "${dataPush.pushItemUrl}") @Value(value = "${dataPush.pushItemUrl}")
private String pushItemUrl; private String pushItemUrl;
@ -125,7 +127,14 @@ public class DataPushApi {
String jsonParams = objectMapper.writeValueAsString(refundRequest); String jsonParams = objectMapper.writeValueAsString(refundRequest);
logger.info("退款请求参数: {}", jsonParams); logger.info("退款请求参数: {}", jsonParams);
RestTemplate restTemplate = new RestTemplate(); 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) { if (response.getStatusCode() == HttpStatus.OK) {

View File

@ -85,6 +85,7 @@ renren:
dataPush: dataPush:
refundUrl: http://115.190.8.52:8019/api/payment/refund refundUrl: http://115.190.8.52:8019/api/payment/refund
alirefundUrl: http://115.190.8.52:8019/api/alipay/refund
pushItemUrl: http://115.190.8.52:8019/item/sync/item pushItemUrl: http://115.190.8.52:8019/item/sync/item
sendAddCompanyUrl: http://115.190.8.52:8016/send/companyinfo/ sendAddCompanyUrl: http://115.190.8.52:8016/send/companyinfo/