update 重试订单退款接口

This commit is contained in:
2023-08-17 14:25:45 +08:00
parent 9a9f0b9d16
commit 999b7a704c
6 changed files with 89 additions and 1 deletions

View File

@@ -695,4 +695,23 @@ public class AdapayMemberService {
log.info("汇付支付创建交易撤销对象param:{}, result:{}", JSON.toJSONString(reverseParams), jsonString);
return JSONObject.parseObject(jsonString, PaymentReverseResponse.class);
}
/**
* 查询支付撤销对象
*
* @return
*/
public List<PaymentReverse> queryPaymentReverse(String paymentId, String wechatAppId) throws BaseAdaPayException {
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(wechatAppId);
if (config == null) {
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
}
Map<String, Object> reverse = Maps.newHashMap();
reverse.put("payment_id", paymentId);
reverse.put("app_id", config.getAdapayAppId());
Map<String, Object> response = PaymentReverse.queryList(reverse, config.getWechatAppId());
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(response));
List<PaymentReverse> payment_reverses = jsonObject.getList("payment_reverses", PaymentReverse.class);
return payment_reverses;
}
}