diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 4bbc970ee..c1ca75c61 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -376,4 +376,6 @@ public interface ClientManager { void switchCBBankLink(JSONObject manager, String clientMoniker, boolean allow); String cbBankPayLink(String clientMoniker); + + void switchPaymentConfigPC(String clientMoniker, HttpServletResponse response) throws IOException; } 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 4f2179824..a809bffdb 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 @@ -4280,7 +4280,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } checkOrgPermission(manager, client); if (StringUtils.isEmpty(client.getString("cb_bankpay_url"))) { - String longUrl = PlatformEnvironment.getEnv().concatUrl("/sys/partners/" + client.getString("client_moniker") + "/cb_bankpay/link"); + String longUrl = PlatformEnvironment.getEnv().concatUrl("/sys/partners/" + client.getString("client_moniker") + "/cb_bankpay/link/pc"); String cb_bankpay_url = getCBBankShortLink(longUrl); client.put("cb_bankpay_url", cb_bankpay_url); client.put("enable_cb_bankpay_link", allow); @@ -4304,6 +4304,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return String.format(PlatformEnvironment.getEnv().concatUrl(paymentConfig.getString("path")), clientMoniker); } + @Override + public void switchPaymentConfigPC(String clientMoniker, HttpServletResponse response) throws IOException { + JSONObject client = clientMapper.findClientByMoniker(clientMoniker); + if (client == null) { + throw new BadRequestException("partner code is not exists!"); + } + JSONObject paymentConfig = sysChannelConfigMapper.findOne(1); + if (paymentConfig == null) { + throw new BadRequestException("服务商未开启快捷支付"); + } + String path = paymentConfig.getString("path"); + path = path.replaceAll("app","pc"); + response.sendRedirect(String.format(PlatformEnvironment.getEnv().concatUrl(path), clientMoniker)); + } + private TemplateMessage initClientMessage(JSONObject client, String newExpiryDate, String wechatOpenid, String templateId) { TemplateMessage notice = new TemplateMessage(wechatOpenid, templateId, null); notice.put("first", "您好,您的合同费率已到期,根据合同协议系统已自动为您延期1年。", "#ff0000"); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index 654263a3c..3b9dcdb6d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -636,4 +636,9 @@ public class PartnerManageController { public String jumpCBBankPayLink(@PathVariable String clientMoniker) { return clientManager.cbBankPayLink(clientMoniker); } + + @RequestMapping(value = "/{clientMoniker}/cb_bankpay/link/pc", method = RequestMethod.GET) + public void switchPaymentWayPC(@PathVariable String clientMoniker, HttpServletResponse response) throws IOException { + clientManager.switchPaymentConfigPC(clientMoniker, response); + } }