From 94aa36f657ea2cc3ef1e4616ecea9ad3a651df96 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 14 Sep 2018 09:18:07 +0800 Subject: [PATCH] add rpoy+ --- pom.xml | 4 + .../manage/merchants/core/ClientManager.java | 3 + .../core/impls/ClientManagerImpl.java | 34 +++++++ .../web/PartnerManageController.java | 92 ++++++++++--------- .../resources/application-rpay.properties | 3 + src/main/resources/application.properties | 2 +- .../static/payment/partner/partner-manage.js | 27 +++++- ..._id.html => apply_wx_sub_merchant_id.html} | 0 .../templates/partner_bankaccounts.html | 1 + .../partner/templates/partner_detail.html | 2 +- .../partner/templates/partner_new_rate.html | 24 +++++ .../templates/sub_merchant_id_apply.html | 17 +++- 12 files changed, 159 insertions(+), 50 deletions(-) create mode 100644 src/main/resources/application-rpay.properties rename src/main/ui/static/payment/partner/templates/{apply_sub_merchant_id.html => apply_wx_sub_merchant_id.html} (100%) diff --git a/pom.xml b/pom.xml index 1e0300dc8..cfb6e206d 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,10 @@ au.com.royalpay.payment jd-core + + au.com.royalpay.payment + rpay-core + com.github.stuxuhai jpinyin 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 368785663..7c0e982ea 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 @@ -330,4 +330,7 @@ public interface ClientManager { void sendHfEmailNotice(JSONObject order); void updateAllPartnerPassword(String clientMoniker, List emails); + + String subRpayMerchantApplication(String clientMoniker, JSONObject manager); + } 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 7364f74c3..a9aa50311 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 @@ -1,10 +1,13 @@ package au.com.royalpay.payment.manage.merchants.core.impls; +import au.com.royalpay.payment.channels.jd.runtime.RpayApi; +import au.com.royalpay.payment.channels.jd.runtime.beans.SubRpayMerchantInfo; import au.com.royalpay.payment.channels.wechat.config.WeChatPayConfig; import au.com.royalpay.payment.channels.wechat.config.WechatPayEnvironment; import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi; import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient; import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfo; + import au.com.royalpay.payment.core.PaymentChannelApi; import au.com.royalpay.payment.core.beans.PayChannel; import au.com.royalpay.payment.core.exceptions.EmailException; @@ -231,6 +234,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private WxPayClient wxPayClient; + @Resource + private RpayApi rpayApi; + @Resource private ManagerMapper managerMapper; @Resource @@ -1553,6 +1559,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid checkAddRate(config, "Bestpay", "bestpay_rate_value", org, "min_bestpay_rate"); checkAddRate(config, "jd", "jd_rate_value", org, "min_jd_rate"); checkAddRate(config, "hf", "hf_rate_value", org, "min_hf_rate"); + checkAddRate(config, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); configNewClientRate(config, clientId, "Wechat", "wechat_rate_value", org, "min_wechat_rate"); configNewClientRate(config, clientId, "Alipay", "alipay_rate_value", org, "min_alipay_rate"); @@ -1560,6 +1567,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid configNewClientRate(config, clientId, "Bestpay", "bestpay_rate_value", org, "min_bestpay_rate"); configNewClientRate(config, clientId, "jd", "jd_rate_value", org, "min_jd_rate"); configNewClientRate(config, clientId, "hf", "hf_rate_value", org, "min_hf_rate"); + configNewClientRate(config, clientId, "Rpay", "Rpay_rate_value", org, "min_Rpay_rate"); } @@ -3527,6 +3535,32 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return sub_merchant_id; } + @Override + public String subRpayMerchantApplication(String clientMoniker, JSONObject manager) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + + SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class); + rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo); + + logger.debug("访问成功,返回的信息是: " ); + + + + // String sub_merchant_id = elem.elementText("sub_mch_id"); +/* if (StringUtils.isNotEmpty(sub_merchant_id)) { + + + + } else { + throw new BadRequestException("请求失败"); + }*/ + return null; + } + @Override public List listMerchantIds(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); 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 66a0af5a9..aa40c3310 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 @@ -77,7 +77,7 @@ public class PartnerManageController { response.setContentType("application/octet-stream;"); response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); OutputStream ous = response.getOutputStream(); - clientManager.writeQrCodeBoard(manager, clientMoniker, config, ous,"PC"); + clientManager.writeQrCodeBoard(manager, clientMoniker, config, ous, "PC"); } @ManagerMapping(value = "/{clientMoniker}/qrcode_board/aggregate", method = RequestMethod.GET) @@ -86,7 +86,7 @@ public class PartnerManageController { response.setContentType("application/octet-stream;"); response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg"); OutputStream ous = response.getOutputStream(); - clientManager.writeAggregateQrCodeBoard(manager, clientMoniker, config, ous,"PC"); + clientManager.writeAggregateQrCodeBoard(manager, clientMoniker, config, ous, "PC"); } @ManagerMapping(value = "/{clientMoniker}/poster", method = RequestMethod.GET) @@ -115,18 +115,18 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/max_order_amount", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void setMaxOrderAmount(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject limit) { - clientManager.setMaxOrderAmount(manager,clientMoniker, limit.getBigDecimal("limit")); + public void setMaxOrderAmount(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject limit) { + clientManager.setMaxOrderAmount(manager, clientMoniker, limit.getBigDecimal("limit")); } @ManagerMapping(value = "/{clientMoniker}/customer_surcharge_rate", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) - public void setCustomerSurchargeRate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setCustomerSurchargeRate(manager,clientMoniker, config.getBigDecimal("customer_surcharge_rate")); + public void setCustomerSurchargeRate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setCustomerSurchargeRate(manager, clientMoniker, config.getBigDecimal("customer_surcharge_rate")); } @ManagerMapping(value = "/{clientMoniker}/order_expiry_config", method = RequestMethod.PUT, role = {ManagerRole.ADMIN}) - public void setOrderExpiryConfig(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setOrderExpiryConfig(manager,clientMoniker, config.getString("order_expiry_config")); + public void setOrderExpiryConfig(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setOrderExpiryConfig(manager, clientMoniker, config.getString("order_expiry_config")); } @ManagerMapping(value = "/{clientMoniker}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR}) @@ -154,6 +154,7 @@ public class PartnerManageController { public void updatePartnerPaymentConfig(@PathVariable String clientMoniker, @RequestBody JSONObject subMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.updateClientPaymentConfig(manager, clientMoniker, subMerchantInfo); } + @ManagerMapping(value = "/{clientMoniker}/ali_sub_merchant_id", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) public void updateAliSubMerchantId(@PathVariable String clientMoniker, @RequestBody JSONObject aliSubMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.updateAliSubMerchantId(manager, clientMoniker, aliSubMerchantInfo); @@ -165,38 +166,38 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/qrcode_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void setClientPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientQRCodePaySurCharge(manager,clientMoniker, config.getBooleanValue("qrcode_surcharge")); + public void setClientPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setClientQRCodePaySurCharge(manager, clientMoniker, config.getBooleanValue("qrcode_surcharge")); } @ManagerMapping(value = "/{clientMoniker}/gateway_upgrade", method = RequestMethod.PUT, role = {ManagerRole.DEVELOPER}) - public void enableGatewayUpgrade(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.enableGatewayUpgrade(manager,clientMoniker, config.getBooleanValue("gateway_upgrade")); + public void enableGatewayUpgrade(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.enableGatewayUpgrade(manager, clientMoniker, config.getBooleanValue("gateway_upgrade")); } @ManagerMapping(value = "/{clientMoniker}/gateway_alipay_online", method = RequestMethod.PUT, role = {ManagerRole.DEVELOPER}) - public void enableGatewayAlipayOnline(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.enableGatewayAlipayOnline(manager,clientMoniker, config.getBooleanValue("gateway_alipay_online")); + public void enableGatewayAlipayOnline(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.enableGatewayAlipayOnline(manager, clientMoniker, config.getBooleanValue("gateway_alipay_online")); } @ManagerMapping(value = "/{clientMoniker}/api_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void setClientApiPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientApiPaySurCharge(manager,clientMoniker, config.getBooleanValue("api_surcharge")); + public void setClientApiPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setClientApiPaySurCharge(manager, clientMoniker, config.getBooleanValue("api_surcharge")); } @ManagerMapping(value = "/{clientMoniker}/retail_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.SERVANT}) - public void setClientRetailPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientRetailPaySurCharge(manager,clientMoniker, config.getBooleanValue("retail_surcharge")); + public void setClientRetailPaySurCharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setClientRetailPaySurCharge(manager, clientMoniker, config.getBooleanValue("retail_surcharge")); } @ManagerMapping(value = "/{clientMoniker}/tax_in_surcharge", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) - public void setClientTaxPayer(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientTaxInSurcharge(manager,clientMoniker, config.getBooleanValue("tax_in_surcharge")); + public void setClientTaxPayer(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setClientTaxInSurcharge(manager, clientMoniker, config.getBooleanValue("tax_in_surcharge")); } @ManagerMapping(value = "/{clientMoniker}/customer_tax_free", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) - public void setClientCustomerTaxFree(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject config) { - clientManager.setClientCustomerTaxFree(manager,clientMoniker, config.getBooleanValue("customer_tax_free")); + public void setClientCustomerTaxFree(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject config) { + clientManager.setClientCustomerTaxFree(manager, clientMoniker, config.getBooleanValue("customer_tax_free")); } @ManagerMapping(value = "/{clientMoniker}/credential_code", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @@ -284,7 +285,7 @@ public class PartnerManageController { return tradeLogService.listOrderRefunds(orderId, null); } - @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR,ManagerRole.DEVELOPER}) + @ManagerMapping(value = "/{clientMoniker}/accounts", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.DIRECTOR, ManagerRole.DEVELOPER}) public List partnerAccounts(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { return clientManager.listAccounts(manager, clientMoniker); } @@ -332,8 +333,8 @@ public class PartnerManageController { } @ManagerMapping(value = "/{clientMoniker}/skip_clearing", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}) - public void skipClearing(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager,@PathVariable String clientMoniker, @RequestBody JSONObject skip_clearing) { - clientManager.setSkipClearing(manager,clientMoniker, skip_clearing.getBooleanValue("skip_clearing")); + public void skipClearing(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestBody JSONObject skip_clearing) { + clientManager.setSkipClearing(manager, clientMoniker, skip_clearing.getBooleanValue("skip_clearing")); } @ManagerMapping(value = "/{clientMoniker}/settle_hour", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SERVANT, ManagerRole.FINANCIAL_STAFF}) @@ -383,7 +384,7 @@ public class PartnerManageController { @RequestParam(required = false) String[] client_ids, @RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listClientDevices(manager, clientMoniker, remark, page, limit,client_type,client_ids); + return clientManager.listClientDevices(manager, clientMoniker, remark, page, limit, client_type, client_ids); } @ManagerMapping(value = "/{clientMoniker}/devices/{devId}", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER}) @@ -442,7 +443,7 @@ public class PartnerManageController { @ManagerMapping(value = "/{clientMoniker}/export/aggregate/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) public void exportAggregateAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception { - clientManager.getAggregateAgreeFile(clientMoniker, manager,false); + clientManager.getAggregateAgreeFile(clientMoniker, manager, false); } @ManagerMapping(value = "/{clientMoniker}/temp/export/pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @@ -452,7 +453,7 @@ public class PartnerManageController { @ManagerMapping(value = "/{clientMoniker}/import/agreepdf", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) public void importAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject source) throws Exception { - clientManager.importAgreeFile(clientMoniker, manager, source.getString("source_agree_file"),false); + clientManager.importAgreeFile(clientMoniker, manager, source.getString("source_agree_file"), false); } @ManagerMapping(value = "/{clientMoniker}/notify/completeAgree", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @@ -502,43 +503,44 @@ public class PartnerManageController { merchantLocationService.updateMerchantLocation(manager, clientMoniker, geoData); } - @ManagerMapping(value = "/{clientMoniker}/wechat_compliance_permission",method = RequestMethod.PUT,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + @ManagerMapping(value = "/{clientMoniker}/wechat_compliance_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public void wechatCcompliancePermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.switchPermission(manager, clientMoniker, "wechat_compliance", pass.getBooleanValue("allow")); } - @ManagerMapping(value = "/{clientMoniker}/local_merchant_permission",method = RequestMethod.PUT,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + @ManagerMapping(value = "/{clientMoniker}/local_merchant_permission", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public void localMerchantPermission(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { clientManager.switchPermission(manager, clientMoniker, "local_merchant", pass.getBooleanValue("allow")); } - @ManagerMapping(value = "/{clientMoniker}/list_sub_applices",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + @ManagerMapping(value = "/{clientMoniker}/list_sub_applices", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public List listSubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listSubMerchantIdApplys(manager,clientMoniker); + return clientManager.listSubMerchantIdApplys(manager, clientMoniker); } - @ManagerMapping(value = "/{clientMoniker}/sub_apply",method = RequestMethod.POST,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + @ManagerMapping(value = "/{clientMoniker}/sub_apply", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public String subMerchantApplication(@PathVariable String clientMoniker, @RequestBody SubMerchantIdApply subMerchantIdApply, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.subMerchantApplication(clientMoniker,subMerchantIdApply,manager); + return clientManager.subMerchantApplication(clientMoniker, subMerchantIdApply, manager); } - @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids",method = RequestMethod.GET,role = {ManagerRole.OPERATOR,ManagerRole.ADMIN}) + @ManagerMapping(value = "/{clientMoniker}/get_merchant_ids", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) public List getMerchantIds(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.listMerchantIds(clientMoniker,manager); + return clientManager.listMerchantIds(clientMoniker, manager); } - @ManagerMapping(value = "/{clientMoniker}/get_sub_merchant_id_logs",method = RequestMethod.GET,role = {ManagerRole.OPERATOR}) + @ManagerMapping(value = "/{clientMoniker}/get_sub_merchant_id_logs", method = RequestMethod.GET, role = {ManagerRole.OPERATOR}) public List getClientSubMerchantIdLogs(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - return clientManager.getClientSubMerchantIdLogs(clientMoniker,manager); + return clientManager.getClientSubMerchantIdLogs(clientMoniker, manager); } - @ManagerMapping(value = "/unsub/{clientMoniker}",method = RequestMethod.PUT,role = {ManagerRole.OPERATOR}) + + @ManagerMapping(value = "/unsub/{clientMoniker}", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR}) public void addSub(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.addSub(clientMoniker,manager); + clientManager.addSub(clientMoniker, manager); } - @ManagerMapping(value = "/unsub/{clientMoniker}",method = RequestMethod.DELETE,role = {ManagerRole.OPERATOR}) + @ManagerMapping(value = "/unsub/{clientMoniker}", method = RequestMethod.DELETE, role = {ManagerRole.OPERATOR}) public void removeSub(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { - clientManager.removeSub(clientMoniker,manager); + clientManager.removeSub(clientMoniker, manager); } @ManagerMapping(value = "/{clientMoniker}/hf", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @@ -551,4 +553,10 @@ public class PartnerManageController { clientManager.switchPermission(manager, clientMoniker, "enable_hf_email_notice", pass.getBooleanValue("allow")); } + @ManagerMapping(value = "/{clientMoniker}/registRpaySubMerchantId", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) + public String subRpayMerchantApplication(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.subRpayMerchantApplication(clientMoniker, manager); + } + + } diff --git a/src/main/resources/application-rpay.properties b/src/main/resources/application-rpay.properties new file mode 100644 index 000000000..e39b8bf00 --- /dev/null +++ b/src/main/resources/application-rpay.properties @@ -0,0 +1,3 @@ +app.privateKey=MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKikZJwvKZ3dj5QsRy6xN/cPinAZa3leg8X40YzGrMEYWc2nmZY/EczYPq/kUp1uL2uikweDO35fuVpA4rALmJwXhHzsZyhVk4lEjHaqH8rNpVpmrwKP9rMmbFD23Mfvvt+BkKWan2T2dAMbSdjPY0+DTS4sN1ZrqzycRFxKFpohAgMBAAECgYBoO0Mb7WJxehFV6ZANYedPQkG0S2HL4AjeAY2yztDTf/NxUpdw74ZW74i/OgV93C5e/lqVmBzbXNq418XEPUaSohOqbcv+QRlEdlTAtn82aAUp/c9oSogPiHWs2VKiGoutejwVXQ6V9BAGMMegLwVphUu9dgrPC4dnfGO11fvLiQJBANt0VPmdqdG52rNVllKhF5+d+dIamOOQewWZf7HnkW0uYt9kWSbZCYyey4nP7NlONL7NEdUxn9exg/DYzegB99sCQQDEudve+jV2Ay6gbOS+ylHoCxSroF6jlkBQ0q7LIsWAAzIVLOuo5skC+wJmHzKXDoQBLXcFerP/T/iUSzisKqSzAkEAmjRVXY02/gLttWQnm+pMckGMgOFlm0oz18xzmSwR2TlmCnk12AFcH26ZsT3kvRGiKIxqwnb7TZIUF1IQ5b00TwJALD7xKNF1vLkyf3p+aDrw+ROk7oT/RCPDC2qXTbDgYs5VMVYNGsvtYfI6s+VIZ5koL2ueXWkfmsjNy+yvLmnY6QJADV9xlAa1+mWN2TfzAugd3L0fNLqPJPHBKQS5/bBKcoZlwfXwByrcCceKaCntJRZ056eQ7IeqkJfxjkEo/kgaRg== +app.rpayPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw4QOJdajtax5/EQ/Tm65tLnaRB3LXrac3jhdOGp+PsQL1tQyRnvKfWDD5qJ2VZ+rSsLUGg//7ubHtuQHFgH8N9BfSDf9PSZLXsgdA0ikAj6/0P+D7VsSAGsw97plXElh3jx1OvKIW46ZFtPgXuotTx1B+4plafhv5JMHMcVYwOGghaDH9Yoh4vaVU6JNw7IWATaycrmAwEns5VVN6uvz2aTYsH8Rb4j2PA8oKW+7ckcF+sCTNJhFK29iHcvLwzGTXrUTaOfk3ZXNhB9g1ou9aolDszUKvj1R7gSoyoq05w6ICno/d0Fu6Oj0H1N36k7OjUt3wX2lm40yu6ymEV6U0QIDAQAB +app.appId=1c8990fa-7568-49f0-b1c2-eee77b3b70be \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4ad7dabda..b35cc059e 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ server.port=5000 -spring.profiles.active=dev,alipay,bestpay,jd,wechat +spring.profiles.active=dev,alipay,bestpay,jd,wechat,rpay env.company=RoyalPay diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 8aced4d4e..63c39ada0 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1888,6 +1888,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.rate.bestpay_rate_value = parseFloat($scope.sysRateConfig.t1.Bestpay); $scope.rate.jd_rate_value = parseFloat($scope.sysRateConfig.t1.JDpay); $scope.rate.hf_rate_value = parseFloat($scope.sysRateConfig.t1.HFpay); + $scope.rate.Rpay_rate_value = parseFloat($scope.sysRateConfig.t1.Rpay); break; } case '2': { @@ -1897,6 +1898,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.rate.alipayonline_rate_value = parseFloat($scope.sysRateConfig.t2.AlipayOnline); $scope.rate.jd_rate_value = parseFloat($scope.sysRateConfig.t2.JDpay); $scope.rate.hf_rate_value = parseFloat($scope.sysRateConfig.t2.HFpay); + $scope.rate.Rpay_rate_value = parseFloat($scope.sysRateConfig.t2.Rpay); break; } case '3': { @@ -1906,6 +1908,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $scope.rate.alipayonline_rate_value = parseFloat($scope.sysRateConfig.t3.AlipayOnline); $scope.rate.jd_rate_value = parseFloat($scope.sysRateConfig.t3.JDpay); $scope.rate.hf_rate_value = parseFloat($scope.sysRateConfig.t3.HFpay); + $scope.rate.Rpay_rate_value = parseFloat($scope.sysRateConfig.t3.Rpay); break; } } @@ -3094,10 +3097,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }); } - $scope.applySubMerchantId = function () { + $scope.applyWxSubMerchantId = function () { $uibModal.open({ - templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html', - controller: 'applySubMerchantIdCtrl', + templateUrl: '/static/payment/partner/templates/apply_wx_sub_merchant_id.html', + controller: 'applyWxSubMerchantIdCtrl', resolve: { subMerchantInfo: function () { return $scope.partner; @@ -3109,10 +3112,26 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }).result.then(function () { $scope.loadSubMerchantInfos(); }) + }; + $scope.applyRpaySubMerchantId = function () { + $http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Wechat Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + + + + }; $scope.loadSubMerchantInfos(); }]); - app.controller('applySubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { + app.controller('applyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { $scope.wxIndustries = angular.copy(wxMerchantIndustries); $scope.subMerchantInfo = angular.copy(subMerchantInfo); $scope.merchantIds = merchantIds.data; diff --git a/src/main/ui/static/payment/partner/templates/apply_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_wx_sub_merchant_id.html similarity index 100% rename from src/main/ui/static/payment/partner/templates/apply_sub_merchant_id.html rename to src/main/ui/static/payment/partner/templates/apply_wx_sub_merchant_id.html diff --git a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html index 667e26b13..624bfb5e4 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -171,6 +171,7 @@
  • Bestpay
  • JDpay
  • HFpay
  • +
  • Rpay+
  • diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index 61739d5fc..0e694b3bd 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -255,7 +255,7 @@ Product
  • - Wechat Merchant Id Applicaitons + Merchant Id Applicaitons
  • Permissions 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 02f7c1875..ee45ccec7 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,6 +160,30 @@ +
    + +
    +
    + +
    %
    +
    +
    +
    + No more than 2.2% +
    +
    + No less than 0.6% +
    +
    + Required Field +
    +
    + +
    +
    +
    diff --git a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html index 4c02dd91b..03309be2c 100644 --- a/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html +++ b/src/main/ui/static/payment/partner/templates/sub_merchant_id_apply.html @@ -31,11 +31,24 @@

    - Sub Merchant Id : {{partner.sub_merchant_id}} + Wechat Sub Merchant Id : {{partner.sub_merchant_id}}

    +
    +
    +
    +
    +

    + Rpay+ Sub Merchant Id : {{partner.sub_merchant_id}} + +

    +