From 268309a200c15a65a4344a1c067a1e75f20c77c0 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 16 Jun 2020 14:35:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E6=8A=A5=E5=A4=87?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchants/core/impls/ClientManagerImpl.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 4857c6c47..3a46dabec 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -5674,7 +5674,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid try { Element responseElement = resultElement.element("response").element("alipay"); if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - throw new BadRequestException(responseElement.elementText("result_code")); + throw new BadRequestException(responseElement.elementText("result_code") + + ":" + responseElement.elementText("reject_reason")); } } catch (Exception e) { throw new ServerErrorException(e); @@ -5694,7 +5695,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return "查询成功:" + resultElement.elementText("error"); } Element responseElement = resultElement.element("response").element("alipay"); - return "查询成功:" + responseElement.elementText("secondary_merchant_id") + "报备状态 : " + responseElement.elementText("status"); + String rejectReason = responseElement.elementText("reject_reason"); + return "查询成功:" + responseElement.elementText("secondary_merchant_id") + + "报备状态:" + responseElement.elementText("status") + StringUtils.defaultString(rejectReason, ""); + } @Override @@ -5798,7 +5802,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid try { Element responseElement = resultElement.element("response").element("alipay"); if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { - throw new BadRequestException(responseElement.elementText("result_code")); + throw new BadRequestException(responseElement.elementText("result_code") + + ":" + responseElement.elementText("reject_reason")); } } catch (Exception e) { throw new ServerErrorException(e); @@ -5842,7 +5847,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return "查询成功:" + resultElement.elementText("error"); } Element responseElement = resultElement.element("response").element("alipay"); - return "查询成功:" + responseElement.elementText("secondary_merchant_id") + "报备状态 : " + responseElement.elementText("status"); + String rejectReason = responseElement.elementText("reject_reason"); + return "查询成功:" + responseElement.elementText("secondary_merchant_id") + + "报备状态:" + responseElement.elementText("status") + StringUtils.defaultString(rejectReason, ""); } @Override