diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index 6f1b2e407..0b3af823a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -7,6 +7,7 @@ import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; +import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.manage.permission.manager.RequirePartner; import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl; @@ -20,6 +21,7 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; +import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; @@ -164,6 +166,14 @@ public class PartnerViewController { clientManager.toggleAccountReceiveNotice(account.getString("client_moniker"), account.getString("account_id"), enable.getBooleanValue("enable")); } + + @PartnerMapping(value = "/{clientMoniker}/order_expiry_config", method = RequestMethod.PUT) + @ResponseBody + public void setOrderExpiryConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setOrderExpiryConfig(account,clientMoniker, config.getString("order_expiry_config")); + } + + @PartnerMapping(value = "/{clientMoniker}/surcharge_account", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @ResponseBody public JSONObject surchargeAccount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 1ddd92b24..2ab7c022a 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -594,6 +594,13 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct }; $scope.ctrl = {}; $scope.reloadQRCode(); + $scope.clientSaveOrderExpiryConfig = function (config) { + $http.put('/client/partner_info/' + $scope.partner.client_moniker + '/order_expiry_config', {order_expiry_config: config}).then(function () { + $scope.ctrl.editOrderExpiryConfig = false; + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }; $scope.changePaymentPage = function () { if (!$scope.paymentInfo) { return; 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 bdd6cf9da..98109a5fe 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 @@ -84,6 +84,31 @@
+
+ +
+

+ {{paymentInfo.order_expiry_config||'Not Configure'}} + 示例:5m(5分钟,最大支持1440m) / 1h(1小时,最大24小时) +

+
+ +
+ +
+
+ +
+
+
+
diff --git a/src/main/ui/static/payment/partner/templates/partner_payment_info.html b/src/main/ui/static/payment/partner/templates/partner_payment_info.html index d7edcf5da..f3580fc86 100644 --- a/src/main/ui/static/payment/partner/templates/partner_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/partner_payment_info.html @@ -156,7 +156,7 @@
-
+