From b5923718834b1a649094400131ae43075846b80c Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Fri, 3 Nov 2023 15:31:43 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=94=AF=E4=BB=98=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E5=90=8E=E9=9D=A2=E6=8B=BC=E4=B8=8A=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/jsowell/adapay/service/AdapayService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java index 106054848..91b461924 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java @@ -136,6 +136,11 @@ public class AdapayService { Map response = Payment.create(BeanMap.create(createAdaPaymentParam), config.getWechatAppId()); log.info("创建汇付支付参数:{}, response:{}", JSON.toJSONString(createAdaPaymentParam), JSON.toJSONString(response)); if (response != null && !response.isEmpty()) { + String status = (String) response.get("status"); + if (!StringUtils.equals(status, AdapayStatusEnum.SUCCEEDED.getValue())) { + String error_msg = (String) response.get("error_msg"); + throw new BusinessException(ReturnCodeEnum.CODE_GET_WECHAT_PAY_PARAMETER_ERROR.getValue(), error_msg); + } JSONObject expend = JSONObject.parseObject(response.get("expend").toString()); JSONObject pay_info = expend.getJSONObject("pay_info"); Map resultMap = JSONObject.parseObject(pay_info.toJSONString(), new TypeReference>() {