校验支付确认是否撤销

This commit is contained in:
2024-01-03 17:07:01 +08:00
parent 946325120d
commit 4c21bf1f9b
6 changed files with 122 additions and 12 deletions

View File

@@ -52,6 +52,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.File;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -1206,4 +1207,21 @@ public class AdapayService {
} while (hasMore);
return resultList;
}
/**
* 查询支付确认撤销对象
*/
public ConfirmReverseResponse queryConfirmReverse(QueryConfirmReverseDTO dto) throws BaseAdaPayException {
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
if (config == null) {
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
}
Map<String, Object> confirmReverseQueryParams = new HashMap<>();
confirmReverseQueryParams.put("adapay_func_code", "payments.confirm.reverse.details");
confirmReverseQueryParams.put("payment_confirm_id", dto.getPaymentConfirmId());
Map<String, Object> confirmReverseQueryResult = AdapayCommon.queryAdapay(confirmReverseQueryParams, config.getWechatAppId());
ConfirmReverseResponse confirmReverseResponse = JSON.parseObject(JSON.toJSONString(confirmReverseQueryResult), ConfirmReverseResponse.class);
log.info("confirmReverseQueryResult:{}", JSON.toJSONString(confirmReverseResponse));
return confirmReverseResponse;
}
}