From 52fda84527896259bbb6532a9a24ae93b0168471 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 25 Jul 2019 16:48:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=85=A8=E9=87=8F=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../dev/core/impl/AliforexcelServiceImpl.java | 35 +++++++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 5f190c5ca..afcf33741 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.0.27 + 1.0.28 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java index 9e8a5a143..04e8acdfe 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/AliforexcelServiceImpl.java @@ -129,24 +129,31 @@ public class AliforexcelServiceImpl implements AliforexcelService { lessInfoMerchant.add(exception); continue; } - AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); - Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); - if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { - JSONObject exception = new JSONObject(); - exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); - registerFailMerchant.add(exception); - continue; - } - Element responseElement = resultElement.element("response").element("alipay"); - if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + try { + AlipayConfig.AlipayMerchant mch = AlipayEnvironment.getEnv().getAlipayOnlineMerchant(); + Element resultElement = alipayClient.registerOnlineGmsPortal(mch.getPid(), client); + if (!StringUtils.equalsIgnoreCase("T", resultElement.elementText("is_success"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + Element responseElement = resultElement.element("response").element("alipay"); + if (!StringUtils.equalsIgnoreCase("SUCCESS", responseElement.elementText("result_code"))) { + JSONObject exception = new JSONObject(); + exception.put("client_moniker", client.getString("client_moniker")); + exception.put("return_msg", resultElement.elementText("error")); + registerFailMerchant.add(exception); + continue; + } + registerSuccessMerchant.add(client.getString("client_moniker")); + } catch (Exception e) { JSONObject exception = new JSONObject(); exception.put("client_moniker", client.getString("client_moniker")); - exception.put("return_msg", resultElement.elementText("error")); + exception.put("return_msg", e.getMessage()); registerFailMerchant.add(exception); - continue; } - registerSuccessMerchant.add(client.getString("client_moniker")); } result.put("need_register_merchant", needRegisterMerchant); result.put("success_register_merchant", registerSuccessMerchant);