From 573ac7db285917e36f7cf461bd5ea47503a4ac3e Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Mon, 17 Jan 2022 13:24:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E6=A8=A1=E7=89=88=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/dev/web/TestController.java | 12 ++++++++++++ .../merchants/core/impls/ClientManagerImpl.java | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java index 561b96da6..70ec27010 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/TestController.java @@ -36,6 +36,7 @@ import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; +import au.com.royalpay.payment.tools.defines.PayChannel; import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.NotFoundException; @@ -255,6 +256,17 @@ public class TestController { if (alipayOnlineRate != null) { client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); } + JSONObject alipayApsCashierRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_CASHIER.getChannelCode()); + if (alipayApsCashierRate != null) { + client.put("aps_cashier_rate", alipayApsCashierRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)+"%"); + client.put("aps_cashier_service_rate", alipayApsCashierRate.getBigDecimal("transaction_fee").setScale(2, RoundingMode.DOWN)+"%"); + } + JSONObject alipayApsInstoreRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()); + if (alipayApsInstoreRate != null) { + client.put("aps_instore_rate", alipayApsInstoreRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)+"%"); + client.put("aps_instore_service_rate",alipayApsInstoreRate.getBigDecimal("transaction_fee").setScale(2, RoundingMode.DOWN)+"%"); + client.put("alipayplus_clean", alipayApsInstoreRate.getString("clean_days")); + } } catch (Exception ignored) { //do nothing } 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 01f19c7d3..390f4f386 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 @@ -3083,6 +3083,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (alipayOnlineRate != null) { client.put("alipay_online_rate", alipayOnlineRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)); } + JSONObject alipayApsCashierRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_CASHIER.getChannelCode()); + if (alipayApsCashierRate != null) { + client.put("aps_cashier_rate", alipayApsCashierRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)+"%"); + client.put("aps_cashier_service_rate", alipayApsCashierRate.getBigDecimal("transaction_fee").setScale(2, RoundingMode.DOWN)+"%"); + } + JSONObject alipayApsInstoreRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()); + if (alipayApsInstoreRate != null) { + client.put("aps_instore_rate", alipayApsInstoreRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)+"%"); + client.put("aps_instore_service_rate", alipayApsInstoreRate.getBigDecimal("transaction_fee").setScale(2, RoundingMode.DOWN)+"%"); + client.put("alipayplus_clean", alipayApsInstoreRate.getString("clean_days")); + } } catch (Exception ignored) { // do nothing }