diff --git a/pom.xml b/pom.xml index adaacec07..cfb6e206d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ au.com.royalpay.payment payment-parent - 0.2.0 + 0.2.0-dev 4.0.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java index 501daac17..7f1236a4e 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/ManualServiceimpl.java @@ -1,7 +1,9 @@ package au.com.royalpay.payment.manage.dev.core.impl; +import au.com.royalpay.payment.channels.rpay.runtime.RpayApi; import au.com.royalpay.payment.manage.dev.core.ManualService; import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify; @@ -40,6 +42,10 @@ public class ManualServiceimpl implements ManualService { private SynchronizedScheduler synchronizedScheduler; @Resource private ClientModifySupport clientModifySupport; + @Resource + private RpayApi rpayApi; + @Resource + private ClientMapper clientMapper; @Override public void clientPostpone() { @@ -82,6 +88,9 @@ public class ManualServiceimpl implements ManualService { record.put("manager_name", "System"); record.put("remark", "费率到期系统自动延期1年"); clientRateMapper.saveRate(record); + if ("Rpay".equals(o.getString("rate_name"))) { + rpayApi.modifySurchargeConfig(clientMapper.findClient(client_id)); + } }); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false)); diff --git a/src/main/java/au/com/royalpay/payment/manage/logview/beans/NotifyQueryBean.java b/src/main/java/au/com/royalpay/payment/manage/logview/beans/NotifyQueryBean.java index 725f63337..72ec88677 100644 --- a/src/main/java/au/com/royalpay/payment/manage/logview/beans/NotifyQueryBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/logview/beans/NotifyQueryBean.java @@ -15,6 +15,10 @@ public class NotifyQueryBean { private int page = 1; private int limit = 20; private String moniker; + + // 新增orderId查询字段 + private String orderId; + private String clientOrderId; private String date; private Boolean success; @@ -24,6 +28,11 @@ public class NotifyQueryBean { if (StringUtils.isNotEmpty(moniker)) { param.put("client_moniker", moniker); } + + if (StringUtils.isNotEmpty(orderId)) { + param.put("order_id", orderId); + } + if (StringUtils.isNotEmpty(clientOrderId)) { param.put("client_order_id", clientOrderId); } @@ -88,4 +97,12 @@ public class NotifyQueryBean { public void setSuccess(Boolean success) { this.success = success; } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } } 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 1785bb42e..6d9da4f29 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 @@ -84,6 +84,7 @@ import au.com.royalpay.payment.manage.support.sms.SmsSender; import au.com.royalpay.payment.manage.system.core.ClientContractService; import au.com.royalpay.payment.manage.system.core.MailGunService; import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; +import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; @@ -1610,6 +1611,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid configNewClientRate(config, clientId, "hf", "hf_rate_value", org, "min_hf_rate"); configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); + rpayApi.modifySurchargeConfig(client); + } private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey, JSONObject org, String rateValueKey) { @@ -1651,6 +1654,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid configJson.put("manager_name", manager.getString("username")); configJson.put("update_time", new Date()); clientRateMapper.updateConfig(configJson); + if ("Rpay".equals(configJson.getString("rate_name"))) { + rpayApi.modifySurchargeConfig(client); + } int clientId = client.getIntValue("client_id"); JSONObject changeRate = merchantInfoProvider.clientCurrentRate(clientId, new Date(), "Wechat"); int cleanDays = changeRate.getIntValue("clean_days"); @@ -3195,6 +3201,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skip_clearing)); + rpayApi.switchMerchantSettle(client); } @Override diff --git a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java b/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java index 18a98a6d7..9b76c96d6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java +++ b/src/main/java/au/com/royalpay/payment/manage/task/PostponeClientTask.java @@ -1,6 +1,8 @@ package au.com.royalpay.payment.manage.task; +import au.com.royalpay.payment.channels.rpay.runtime.RpayApi; import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; import au.com.royalpay.payment.manage.merchants.core.ClientManager; @@ -52,6 +54,10 @@ public class PostponeClientTask { private SynchronizedScheduler synchronizedScheduler; @Resource private ClientModifySupport clientModifySupport; + @Resource + private RpayApi rpayApi; + @Resource + private ClientMapper clientMapper; @Scheduled(cron = "0 30 8 * * ?") public void postponeClient() { @@ -93,7 +99,9 @@ public class PostponeClientTask { record.put("manager_name", "System"); record.put("remark", "费率到期系统自动延期1年"); clientRateMapper.saveRate(record); - + if ("Rpay".equals(o.getString("rate_name"))) { + rpayApi.modifySurchargeConfig(clientMapper.findClient(client_id)); + } }); clientModifySupport.processClientConfigModify(new SwitchPermissionModify(null, p.getString("client_moniker"), "tax_in_surcharge", false)); adminAccounts.forEach(o -> { diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.xml index 66e84f217..3e17fbc8e 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/NotifyErrorLogMapper.xml @@ -1,6 +1,8 @@ + + + + + + + +
@@ -61,6 +76,7 @@ Time Order ID + Client Order ID Notify Url Success Http Code @@ -71,7 +87,8 @@ - + + diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index e4cdb0451..7096890c6 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -560,7 +560,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct }; }]); - app.controller('clientPaymentInfoCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { + app.controller('clientPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', function ($scope, $http, $state, commonDialog) { $scope.paymentInfo = $scope.partner; $scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate); $scope.qrConfig = {currency: 'AUD'}; @@ -829,7 +829,25 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct $scope.bankshow = false; }; - + // 新增需求,商户端刷新支付秘钥 + $scope.refreshCredential = function () { + commonDialog.confirm({ + title: 'Warning', + content: 'Refresh Credential will expire the current one, ' + + 'which will cause the current payment service disabled. ' + + 'Are you sure going on?' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/credential_code').then(function () { + $state.reload(); + }, function (resp) { + commonDialog.alert({ + title: 'Error', + content: resp.data.message, + type: 'error' + }) + }) + }) + }; }]); app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) { diff --git a/src/main/ui/static/payment/partner/templates/client_payment_info.html b/src/main/ui/static/payment/partner/templates/client_payment_info.html index 534d6ca61..ad9158a14 100644 --- a/src/main/ui/static/payment/partner/templates/client_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/client_payment_info.html @@ -87,7 +87,15 @@
-

+

+ + + + +

diff --git a/src/main/ui/static/payment/partner/templates/partner_new_rate.html b/src/main/ui/static/payment/partner/templates/partner_new_rate.html index 19267e23d..fe0aa512f 100644 --- a/src/main/ui/static/payment/partner/templates/partner_new_rate.html +++ b/src/main/ui/static/payment/partner/templates/partner_new_rate.html @@ -160,30 +160,6 @@
-
- -
-
- -
%
-
-
-
- No more than 2.2% -
-
- No less than 0.6% -
-
- Required Field -
-
- -
-
-