From 2825e64a9e370f0a5abfbd9c7cc1c748d9326f0a Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 17 Feb 2020 14:13:32 +0800 Subject: [PATCH] fix rsvc --- pom.xml | 2 +- .../appclient/core/impls/RetailRSvcServiceImpl.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index ac4bb3e19..d021aa3e3 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.3.37 + 1.3.38 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java index 5999a6f4d..e44363a17 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailRSvcServiceImpl.java @@ -92,8 +92,7 @@ public class RetailRSvcServiceImpl implements RetailRSvcService { if (client == null) { throw new InvalidShortIdException(); } - String aesKeyStr = Base64.encodeBase64String(AESCrypt.randomKey().getEncoded()); - Key key = AESCrypt.fromKeyString(Base64.decodeBase64(aesKeyStr)); + Key key = AESCrypt.fromKeyString(Base64.decodeBase64(params.getString("nonce_str"))); JSONObject serviceApply = new JSONObject(); serviceApply.put("apply_id", UUID.randomUUID().toString()); serviceApply.put("service_code", sourceCode); @@ -108,6 +107,7 @@ public class RetailRSvcServiceImpl implements RetailRSvcService { clientServicesApplyMapper.save(serviceApply); result.put("result_status", "PROCESSING"); } catch (Exception e) { + logger.error("enter R services fail:{} - {}",sourceCode,e.getMessage()); result.put("result_status", "SYSTEMERROR"); result.put("result_msg", e.getMessage()); } @@ -120,7 +120,7 @@ public class RetailRSvcServiceImpl implements RetailRSvcService { } private String decData(String data, Key key, String privateKey) { - String priKeyDecData = SignUtils.decData(data, privateKey); - return org.apache.commons.codec.binary.Base64.encodeBase64String(AESCrypt.encrypt(priKeyDecData.getBytes(StandardCharsets.UTF_8), key)); + String aesData = new String(AESCrypt.decrypt(Base64.decodeBase64(data), key), StandardCharsets.UTF_8); + return SignUtils.decData(aesData, privateKey); } }