update 支付时获取对应的支付配置

This commit is contained in:
2023-08-17 11:55:14 +08:00
parent 85d49e3be8
commit ae5f0d8faf
8 changed files with 42 additions and 15 deletions

View File

@@ -600,7 +600,7 @@ public class MemberService {
*/
public Map<String, Object> rechargeBalanceWithAdapay(WeixinPayDTO dto) {
// 获取支付配置
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getAppId());
AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId());
if (config == null) {
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR);
}

View File

@@ -11,6 +11,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.huifu.adapay.core.AdapayCore;
import com.huifu.adapay.core.util.AdapaySign;
import com.jsowell.adapay.response.PaymentReverseResponse;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
@@ -934,7 +935,7 @@ public class OrderService {
corpMemberSucceeded(data);
} else if (AdapayEventEnum.payment_reverse_succeeded.getValue().equals(type)) {
// 支付撤销成功
paymentReverseSucceeded(data);
} else if (AdapayEventEnum.cash_succeeded.getValue().equals(type)) {
cashSucceeded(data);
} else if (AdapayEventEnum.cash_failed.getValue().equals(type)) {
@@ -1099,4 +1100,16 @@ public class OrderService {
clearingWithdrawInfoService.updateByPrimaryKeySelective(clearingWithdrawInfo);
}
/**
* 支付撤销成功
*/
private void paymentReverseSucceeded(String data) throws JsonProcessingException {
JSONObject jsonObject = JSON.parseObject(data);
ObjectMapper mapper = new ObjectMapper();
mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
PaymentReverseResponse paymentReverseResponse = mapper.readValue(jsonObject.toJSONString(), PaymentReverseResponse.class);
log.info("支付撤销成功 paymentReverseResponse:{}", JSON.toJSONString(paymentReverseResponse));
}
}