From 94aa36f657ea2cc3ef1e4616ecea9ad3a651df96 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 14 Sep 2018 09:18:07 +0800 Subject: [PATCH 01/35] 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}} + +

    + From a0e5de2690f9224bd86a9db7edcbf3cc033c8da4 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Fri, 14 Sep 2018 09:20:52 +0800 Subject: [PATCH 02/35] update --- .../manage/apps/core/impls/CustomerImpressionImplTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java b/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java index fdf9c7290..6d1c6a9ae 100644 --- a/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionImplTest.java @@ -617,6 +617,7 @@ public class CustomerImpressionImplTest { } return result; + } @Test From 354985e2425fbf438d6256ac95c5e6eb7dab6514 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 14 Sep 2018 09:26:47 +0800 Subject: [PATCH 03/35] rollback --- .../static/payment/partner/templates/partner_bankaccounts.html | 1 + 1 file changed, 1 insertion(+) 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..49679a2f3 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -206,6 +206,7 @@ +
    \ No newline at end of file From bb4d1f9209c0678857c5edded69259513ef62077 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Fri, 14 Sep 2018 09:28:00 +0800 Subject: [PATCH 04/35] Revert "add rpoy+" This reverts commit 94aa36f657ea2cc3ef1e4616ecea9ad3a651df96. --- 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 +----- ...ant_id.html => apply_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, 50 insertions(+), 159 deletions(-) delete mode 100644 src/main/resources/application-rpay.properties rename src/main/ui/static/payment/partner/templates/{apply_wx_sub_merchant_id.html => apply_sub_merchant_id.html} (100%) diff --git a/pom.xml b/pom.xml index cfb6e206d..1e0300dc8 100644 --- a/pom.xml +++ b/pom.xml @@ -36,10 +36,6 @@ 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 7c0e982ea..368785663 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,7 +330,4 @@ 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 a9aa50311..7364f74c3 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,13 +1,10 @@ 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; @@ -234,9 +231,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private WxPayClient wxPayClient; - @Resource - private RpayApi rpayApi; - @Resource private ManagerMapper managerMapper; @Resource @@ -1559,7 +1553,6 @@ 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"); @@ -1567,7 +1560,6 @@ 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"); } @@ -3535,32 +3527,6 @@ 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 aa40c3310..66a0af5a9 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,7 +154,6 @@ 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); @@ -166,38 +165,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}) @@ -285,7 +284,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); } @@ -333,8 +332,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}) @@ -384,7 +383,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}) @@ -443,7 +442,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}) @@ -453,7 +452,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}) @@ -503,44 +502,43 @@ 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}) @@ -553,10 +551,4 @@ 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 deleted file mode 100644 index e39b8bf00..000000000 --- a/src/main/resources/application-rpay.properties +++ /dev/null @@ -1,3 +0,0 @@ -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 b35cc059e..4ad7dabda 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,rpay +spring.profiles.active=dev,alipay,bestpay,jd,wechat 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 63c39ada0..8aced4d4e 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -1888,7 +1888,6 @@ 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': { @@ -1898,7 +1897,6 @@ 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': { @@ -1908,7 +1906,6 @@ 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; } } @@ -3097,10 +3094,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }); } - $scope.applyWxSubMerchantId = function () { + $scope.applySubMerchantId = function () { $uibModal.open({ - templateUrl: '/static/payment/partner/templates/apply_wx_sub_merchant_id.html', - controller: 'applyWxSubMerchantIdCtrl', + templateUrl: '/static/payment/partner/templates/apply_sub_merchant_id.html', + controller: 'applySubMerchantIdCtrl', resolve: { subMerchantInfo: function () { return $scope.partner; @@ -3112,26 +3109,10 @@ 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('applyWxSubMerchantIdCtrl', ['$scope', '$http', '$uibModal', '$state', 'subMerchantInfo', '$filter', 'merchantIds', 'commonDialog', function ($scope, $http, $uibModal, $state, subMerchantInfo, $filter, merchantIds, commonDialog) { + app.controller('applySubMerchantIdCtrl', ['$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_wx_sub_merchant_id.html b/src/main/ui/static/payment/partner/templates/apply_sub_merchant_id.html similarity index 100% rename from src/main/ui/static/payment/partner/templates/apply_wx_sub_merchant_id.html rename to src/main/ui/static/payment/partner/templates/apply_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 f1e00b160..49679a2f3 100644 --- a/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html +++ b/src/main/ui/static/payment/partner/templates/partner_bankaccounts.html @@ -171,7 +171,6 @@
  • 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 0e694b3bd..61739d5fc 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
  • - Merchant Id Applicaitons + Wechat 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 ee45ccec7..02f7c1875 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 -
    -
    - -
    -
    -
    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 03309be2c..4c02dd91b 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,24 +31,11 @@

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

    -
    -
    -
    -
    -

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

    - From b72cba1a1d0d2d25c591d1e6b763f41b4d6eefc9 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Fri, 14 Sep 2018 13:52:06 +0800 Subject: [PATCH 05/35] =?UTF-8?q?mybatis=20=E5=BB=B6=E8=BF=9F=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mybatis-config.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/mybatis-config.xml b/src/main/resources/mybatis-config.xml index 5849c55f3..e662da9d5 100644 --- a/src/main/resources/mybatis-config.xml +++ b/src/main/resources/mybatis-config.xml @@ -3,6 +3,7 @@ + From c0ec8defeaf77f31a1b3031dc3f573bfd55b9320 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 14 Sep 2018 15:08:43 +0800 Subject: [PATCH 06/35] ATO Report, --- .../payment/manage/analysis/beans/ato/AddressInfo.java | 7 +++++-- .../payment/manage/process/ato/ExportATOReport.java | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/AddressInfo.java b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/AddressInfo.java index a59de68b0..02ac63210 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/AddressInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/beans/ato/AddressInfo.java @@ -13,15 +13,18 @@ public class AddressInfo { public AddressInfo(String address, String suburb, String state, String postCode, String country) { this.address = address; this.suburb = suburb; - this.state = state; if (!postCode.matches("^\\d{4}$")) { postCode = "9999"; country = "OTH"; + state = "OTH"; } - this.postCode = postCode; if (country != null && country.length() != 3) { country = "OTH"; + state = "OTH"; + postCode = "9999"; } + this.postCode = postCode; + this.state = state; this.country = country; } diff --git a/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java b/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java index eb195443f..0c17dd0c9 100644 --- a/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java +++ b/src/test/java/au/com/royalpay/payment/manage/process/ato/ExportATOReport.java @@ -28,7 +28,7 @@ public class ExportATOReport { @Test public void export() throws IOException { - String content = atoReportService.exportBTTPSFile(DateTime.parse("2017-07-01").toDate(), DateTime.parse("2017-07-31").toDate()); - FileUtils.write(new File("C:\\Users\\yixian\\Documents\\royalpay2017070120170731.bttps"), content, StandardCharsets.US_ASCII); + String content = atoReportService.exportBTTPSFile(DateTime.parse("2017-07-01").toDate(), DateTime.parse("2018-06-30").toDate()); + FileUtils.write(new File("C:\\Users\\yixian\\Documents\\royalpay2017070120180630.bttps"), content, StandardCharsets.US_ASCII); } } From aadf58d2110d3f71582bd31d28d0e50cbb878ced Mon Sep 17 00:00:00 2001 From: hellolujian <1370256381@qq.com> Date: Fri, 14 Sep 2018 19:43:29 +0800 Subject: [PATCH 07/35] =?UTF-8?q?[fix]=E7=BA=A2=E5=8C=85=E5=85=B3=E8=81=94?= =?UTF-8?q?globalpay=5Fopenid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/redpack/ActPartnerLMLogMapper.xml | 24 +++++++++++++------ .../ActRedPacketsCustomerOrdersMapper.xml | 8 +++++-- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.xml index 0ca13ae4e..a0663b740 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActPartnerLMLogMapper.xml @@ -52,12 +52,18 @@ - SELECT count(1) FROM act_red_packets_orders WHERE open_id=#{open_id} and date(event_time) = date(#{event_date}) and status !=0 and act_id = '2' + SELECT count(1) + FROM act_red_packets_orders + WHERE open_id=#{open_id} + and date(event_time) = date(#{event_date}) + and status !=0 and act_id = '2' diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.xml index 55621d54a..4e58cf59b 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/redpack/ActRedPacketsCustomerOrdersMapper.xml @@ -24,15 +24,19 @@ AND status != 0 AND act_id = #{act_id} + ').addClass('remark-input').attr('name', 'remark').val(dataCache.remark || '').appendTo($('.weui_dialog_bd', dialog)); + }, + confirm: function (dialog, chosen) { + if (chosen) { + var remark = $('textarea[name="remark"]', dialog).val(); + if (remark) { + $('#remark-box').text('备注:' + remark).show() + } else { + $('#remark-box').text('').hide(); + } + dataCache.remark = remark; + } + + } + }; + showWeuiDialog(cfg); + }); + + $('.paydetail').click(function () { + var config = { + title: 'Payment Detail', + template: '', + initialize: function (dialog) { + var bd = $('.weui_dialog_bd', dialog); + var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; + $('

    ').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd); + if (parseFloat(dataCache.customSurcharge) > 0) { + $('

    ').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd); + } + $(dataCache.discounts).each(function () { + $('

    ').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd); + }); + $('

    ').addClass('final').html('Final 支付金额:' + currencySymbol + (dataCache.finalPrice || 0)).appendTo(bd); + } + }; + showWeuiDialog(config); + }); + + $('#key_P').click(function () { + if (window.requireRemark) { + if (!dataCache.remark) { + var config = { + title: '请先输入备注', + template: '' + }; + showWeuiDialog(config); + } + + } + }); + + $('#key_P').bind('touchstart', function () { + if (window.requireRemark) { + if (!dataCache.remark) { + return; + } + } + $('#key_P').addClass('hidden'); + $('#key_Loading').removeClass('hidden'); + if (dataCache.paying) { + return; + } + dataCache.paying = true; + var data = {price: dataCache.price + '', original_number: true, currency: window.currency}; + if (dataCache.remark) { + data.description = dataCache.remark; + } + if (window.extensions.indexOf('preauthorize') >= 0) { + data.preauthorize = true; + } + if (window.extensions.indexOf('qrcodemode') >= 0) { + data.qrmode = true; + } + if (window.extensions.indexOf('customerrate') >= 0) { + data.customerrate = true; + } + data.coupons = dataCache.coupons; + data.qrcodeVersion = window.qrcodeVersion; + + dataCache.remark = ''; + $.ajax({ + url: '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders', + method: 'POST', + data: JSON.stringify(data), + contentType: 'application/json', + dataType: 'json', + success: function (resp) { + pay(resp); + if (resp.direct_paid) { + location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'; + return; + } + // if (window.AlipayJSBridge) { + // callPayment(); + // } else { + // // 如果没有注入则监听注入的事件 + // document.addEventListener('AlipayJSBridgeReady', callPayment, false); + // } + // + // function callPayment() { + // try { + // AlipayJSBridge.call('tradePay', { + // tradeNO: pay.trade_no + // }, function (res) { + // dataCache.paying = false; + // if (res.resultCode == '9000') { + // AlipayJSBridge.call('startApp', { + // appId: '20000056', + // param: { + // actionType: 'showSuccPage', + // payResult: res.result + // }, + // closeCurrentApp: false + // }); + // startCheckOrder(pay.order_id, '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'); + // } else if (res.resultCode == '6001') { + // //do nothing + // } else { + // if (res.memo) { + // weuiAlert(res.memo); + // } + // } + // $('#key_P').removeClass('hidden'); + // $('#key_Loading').addClass('hidden'); + // }) + // } catch (err) { + // weuiAlert(err) + // } + // } + }, + error: function (jqXhr) { + weuiAlert(jqXhr.responseJSON.message); + $('#key_P').removeClass('hidden'); + $('#key_Loading').addClass('hidden'); + dataCache.paying = false; + } + }) + }); + + function startCheckOrder(orderId, url) { + function checkOrderStd() { + $.ajax({ + url: '/api/v1.0/payment/orders/' + orderId + '/status', + method: 'GET', + dataType: 'json', + success: function (res) { + if (res.paid) { + location.href = url; + } else { + setTimeout(checkOrderStd, 500); + } + } + }) + } + + checkOrderStd(); + } + + function weuiAlert(msg) { + var config = { + template: msg + }; + showWeuiDialog(config); + } + + function showWeuiDialog(config) { + if (config.templateUrl) { + $.ajax({ + url: config.templateUrl, + dataType: 'html', + success: function (template) { + buildDialog(template); + } + }); + } else { + buildDialog(config.template); + } + + + function buildDialog(template) { + var defaultConfig = {backdrop: true}; + config = $.extend({}, defaultConfig, config); + var dialog = $("
    ", {class: 'weui_dialog_confirm'}); + var mask = $('
    ', {class: 'weui_mask'}).appendTo(dialog); + if (config.backdrop) { + mask.click(function () { + dialog.remove(); + if ($.isFunction(config.dismiss)) { + config.dismiss(); + } + }) + } + var dialogBox = $("
    ", {class: 'weui_dialog'}).appendTo(dialog); + if (config.title) { + $('
    ', {class: 'weui_dialog_hd'}).append($('', {class: 'weui_dialog_title'}).html(config.title)).appendTo(dialogBox); + } + var dialogBody = $("
    ", {class: 'weui_dialog_bd'}).appendTo(dialogBox); + if (template) { + dialogBody.append(template); + } + if ($.isFunction(config.initialize)) { + config.initialize(dialog); + } + var ft = $('
    ').appendTo(dialogBox); + if ($.isFunction(config.confirm)) { + var yes = $('', { + class: 'weui_btn_dialog primary', + text: 'OK', + style: 'background: #108ee9;color: #fff;' + }).appendTo(ft); + yes.click(function () { + config.confirm(dialog, true); + dialog.remove(); + }); + var no = $('', {class: 'weui_btn_dialog default', text: 'Cancel'}).appendTo(ft); + no.click(function () { + config.confirm(dialog, false); + dialog.remove(); + }) + } else { + var ok = $('', { + class: 'weui_btn_dialog primary', + text: 'OK', + style: 'background: #108ee9;color: #fff;' + }).appendTo(ft); + ok.click(function () { + dialog.remove(); + }) + } + dialog.appendTo($('body')); + } + + } + + + function getUserId(){ + window.RPayPlus.send("getUserId", null, function(data){ + alert(data); + }); + } + + function pay(param){ + var order={ + nonce_str:param.nonce_str, + rpay_order_id:param.rpay_order_id, + mch_order_id:param.mch_order_id + }; + alert("rpay_order_info: nonce_str:"+param.nonce_str+"rpay_order_id:"+param.rpay_order_id+"mch_order_id:"+param.mch_order_id); + window.RPayPlus.send('pay', order, function(data){ + alert('this is callback from native and data='+JSON.stringify(data)); + }); + } + + function back(){ + window.RPayPlus.send("back", null, null); + } + + function jsInvoke(){ + window.RPayPlus.send("jsInvoke", 'Native Test', null); + } + + function createOrder(msg){ + alert('create order information='+JSON.stringify(msg)); + } + + function queryOrder(msg){ + alert('query order information='+JSON.stringify(msg)); + + var order={ + orderId:'00001', + amount:'$10.98', + title:'Balance Top-UP' + }; + setTimeout("window.RPayPlus.onResult("+JSON.stringify(order)+");", 1500); + } + + function registerJs(){ + window.RPayPlus.register('createOrder', function(data){ + createOrder(data); + }); + window.RPayPlus.register('queryOrder', function(data){ + queryOrder(data); + }); + } + getUserId(); +}); \ No newline at end of file diff --git a/src/main/ui/static/templates/rpay/v1/retail_jsapi.js b/src/main/ui/static/templates/rpay/v1/retail_jsapi.js new file mode 100644 index 000000000..6b74c75cf --- /dev/null +++ b/src/main/ui/static/templates/rpay/v1/retail_jsapi.js @@ -0,0 +1,97 @@ +/** + * Created by yixian on 2016-07-15. + */ +$(document).ready(function () { + 'use strict'; + decode(); + function decode() { + var redirect = window.redirect; + while(redirect.indexOf('://')<0){ + redirect = decodeURIComponent(redirect); + if(redirect==window.redirect){ + break; + } + window.redirect = redirect; + } + } + var dataCache = {paying: false}; + $('#key_P').bind('touchstart', startPay); + function startPay() { + $('#wdiv').show(); + if (dataCache.paying) { + return; + } + dataCache.paying = true; + + $.ajax({ + url: '/api/v1.0/alipay/partners/' + window.client_moniker + '/orders/'+window.order_id+'/order_params', + method: 'GET', + dataType: 'json', + success: function (pay) { + if (pay.direct_paid) { + location.href = window.redirect; + return; + } + if (window.AlipayJSBridge) { + callPayment(); + } else { + // 如果没有注入则监听注入的事件 + document.addEventListener('AlipayJSBridgeReady', callPayment, false); + } + + function callPayment() { + try { + AlipayJSBridge.call('tradePay', { + tradeNO: pay.trade_no + }, function (res) { + dataCache.paying = false; + if (res.resultCode == '9000') { + AlipayJSBridge.call('startApp', { + appId: '20000056', + param: { + actionType: 'showSuccPage', + payResult: res.result + }, + closeCurrentApp: false + }); + startCheckOrder(window.order_id, window.redirect); + } else { + alert(res.memo); + } + $('#wdiv').hide(); + }) + } catch (err) { + alert(err); + $('#wdiv').hide(); + } + } + }, + error: function (jqXhr) { + alert(jqXhr.responseJSON.message); + $('#wdiv').hide(); + dataCache.paying = false; + } + }) + + + } + + function startCheckOrder(orderId, url) { + function checkOrderStd() { + $.ajax({ + url: '/api/v1.0/payment/orders/' + orderId + '/status', + method: 'GET', + dataType: 'json', + success: function (res) { + if (res.paid) { + location.href = url; + } else { + setTimeout(checkOrderStd, 500); + } + } + }) + } + + checkOrderStd(); + } +}); \ No newline at end of file From 7ec5f960872b29fee262698f86d3e46ca8ea2d05 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 14 Sep 2018 19:49:17 +0800 Subject: [PATCH 09/35] rollback --- .../manage/merchants/core/impls/ClientManagerImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 a9aa50311..7b5c0631a 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,7 +1,7 @@ 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.rpay.runtime.RpayApi; +import au.com.royalpay.payment.channels.rpay.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; @@ -170,6 +170,7 @@ import javax.annotation.Resource; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import cn.yixblog.platform.http.HttpRequestGenerator; import cn.yixblog.platform.http.HttpRequestResult; @@ -3544,6 +3545,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid checkOrgPermission(manager, client); SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class); + subRpayMerchantInfo.CheckEmpty(); rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo); logger.debug("访问成功,返回的信息是: " ); From dd6392c625e09203dff5fc61ed4676ce7e5679d5 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Fri, 14 Sep 2018 20:19:38 +0800 Subject: [PATCH 10/35] update --- src/main/resources/application-rpay.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application-rpay.properties b/src/main/resources/application-rpay.properties index 1b361a41f..603d8f0e1 100644 --- a/src/main/resources/application-rpay.properties +++ b/src/main/resources/application-rpay.properties @@ -1,3 +1,3 @@ -app.rpay.private-key=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.rpay.rpay-public-key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw4QOJdajtax5/EQ/Tm65tLnaRB3LXrac3jhdOGp+PsQL1tQyRnvKfWDD5qJ2VZ+rSsLUGg//7ubHtuQHFgH8N9BfSDf9PSZLXsgdA0ikAj6/0P+D7VsSAGsw97plXElh3jx1OvKIW46ZFtPgXuotTx1B+4plafhv5JMHMcVYwOGghaDH9Yoh4vaVU6JNw7IWATaycrmAwEns5VVN6uvz2aTYsH8Rb4j2PA8oKW+7ckcF+sCTNJhFK29iHcvLwzGTXrUTaOfk3ZXNhB9g1ou9aolDszUKvj1R7gSoyoq05w6ICno/d0Fu6Oj0H1N36k7OjUt3wX2lm40yu6ymEV6U0QIDAQAB -app.rpay.app-id=ae8c8000-d774-42ad-8008-810b55c96aa9 \ No newline at end of file +app.rpay.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.rpay.rpayPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw4QOJdajtax5/EQ/Tm65tLnaRB3LXrac3jhdOGp+PsQL1tQyRnvKfWDD5qJ2VZ+rSsLUGg//7ubHtuQHFgH8N9BfSDf9PSZLXsgdA0ikAj6/0P+D7VsSAGsw97plXElh3jx1OvKIW46ZFtPgXuotTx1B+4plafhv5JMHMcVYwOGghaDH9Yoh4vaVU6JNw7IWATaycrmAwEns5VVN6uvz2aTYsH8Rb4j2PA8oKW+7ckcF+sCTNJhFK29iHcvLwzGTXrUTaOfk3ZXNhB9g1ou9aolDszUKvj1R7gSoyoq05w6ICno/d0Fu6Oj0H1N36k7OjUt3wX2lm40yu6ymEV6U0QIDAQAB +app.rpay.appId=ae8c8000-d774-42ad-8008-810b55c96aa9 \ No newline at end of file From 8eb861edf39c5104a242322e0ebe2dc3d8413a45 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 17 Sep 2018 11:57:54 +0800 Subject: [PATCH 11/35] update rpay html --- src/main/ui/static/lib/rpay/rpay_jssdk.js | 2 +- src/main/ui/static/templates/payment/v2/payment.css | 3 +++ src/main/ui/static/templates/rpay/v1/payment.js | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/lib/rpay/rpay_jssdk.js b/src/main/ui/static/lib/rpay/rpay_jssdk.js index e3f48ea99..4bc92ae54 100644 --- a/src/main/ui/static/lib/rpay/rpay_jssdk.js +++ b/src/main/ui/static/lib/rpay/rpay_jssdk.js @@ -21,7 +21,7 @@ $(function (){ if(isiOS){ window.webkit.messageHandlers.rpayplus.postMessage(msg); } else{ - rpayplus.send(msg); + //rpayplus.send(msg); } }, diff --git a/src/main/ui/static/templates/payment/v2/payment.css b/src/main/ui/static/templates/payment/v2/payment.css index e2b39f2b5..9564c3027 100644 --- a/src/main/ui/static/templates/payment/v2/payment.css +++ b/src/main/ui/static/templates/payment/v2/payment.css @@ -431,6 +431,9 @@ input.value:focus { .keyboard-grids .key.paynow.alipay { background: #108ee9; } +.keyboard-grids .key.paynow.rpay { + background: #FF2D55; +} .alipay { color: #108ee9; diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index 0f34739ab..316fc80c3 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -385,7 +385,7 @@ $(function () { var yes = $('', { class: 'weui_btn_dialog primary', text: 'OK', - style: 'background: #108ee9;color: #fff;' + style: 'background: #FF2D55;color: #fff;' }).appendTo(ft); yes.click(function () { config.confirm(dialog, true); @@ -400,7 +400,7 @@ $(function () { var ok = $('', { class: 'weui_btn_dialog primary', text: 'OK', - style: 'background: #108ee9;color: #fff;' + style: 'background: #FF2D55;color: #fff;' }).appendTo(ft); ok.click(function () { dialog.remove(); From bef28c176ea51bb8ffc737e7f3674865db382744 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 17 Sep 2018 13:09:43 +0800 Subject: [PATCH 12/35] settlement mail password source-dev version hotfix --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c177b3c0f..1e0300dc8 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 From d416b2265f0239a260035ea903d6bc6c009feba3 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Mon, 17 Sep 2018 13:59:39 +0800 Subject: [PATCH 13/35] tmp --- .../ui/static/templates/rpay/v1/payment.js | 43 ++++--------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index 316fc80c3..c42004284 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -62,11 +62,9 @@ $(function () { var checked = $(this).is('.checked'); if (checked) { dataCache.coupons.push(couponId); - updatePrice(); } else { var idx = dataCache.coupons.indexOf(couponId); dataCache.coupons.splice(idx, 1); - updatePrice(); } }); @@ -89,29 +87,6 @@ $(function () { return price; } - function updatePrice() { - $('#audVal').html(dataCache.price); - var realPrice = dataCache.price; - $('#audValReal').html(realPrice); - var surchargeData = calculateSurcharge(realPrice); - - var price = surchargeData.newPrice || realPrice; - var priceBeforeDiscount = price; - dataCache.discounts = []; - dataCache.tax = surchargeData.tax; - dataCache.surcharge = surchargeData.surcharge; - - $(window.coupons).each(function () { - price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); - }); - dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP); - dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR); - var rate = 'CNY' == window.currency ? 1 : exchangeRate; - var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP); - $('#cnyVal').html(cnyVal); - dataCache.currencyPrice = 'CNY' == window.currency ? Decimal.div(priceBeforeDiscount, exchangeRate).toFixed(2, Decimal.ROUND_FLOOR) : priceBeforeDiscount; - } - function updatePoundageStatus() { $(window.coupons).each(function () { var coupon = this; @@ -142,7 +117,6 @@ $(function () { if (dataCache.price.length == 0) { dataCache.price = '0'; } - updatePrice(); updatePoundageStatus(); } @@ -159,7 +133,6 @@ $(function () { dataCache.price = ''; } dataCache.price += char; - updatePrice(); updatePoundageStatus(); } } @@ -257,6 +230,9 @@ $(function () { data.qrcodeVersion = window.qrcodeVersion; dataCache.remark = ''; + + window.RPayPlus.send("showLoading", null, null); + $.ajax({ url: '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders', method: 'POST', @@ -264,7 +240,8 @@ $(function () { contentType: 'application/json', dataType: 'json', success: function (resp) { - pay(resp); + window.RPayPlus.send("closeLoading", null, null); + // pay(resp); if (resp.direct_paid) { location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'; return; @@ -308,6 +285,7 @@ $(function () { // } }, error: function (jqXhr) { + window.RPayPlus.send("closeLoading", null, null); weuiAlert(jqXhr.responseJSON.message); $('#key_P').removeClass('hidden'); $('#key_Loading').addClass('hidden'); @@ -412,9 +390,8 @@ $(function () { } - function getUserId(){ + /* function getUserId(){ window.RPayPlus.send("getUserId", null, function(data){ - alert(data); }); } @@ -425,9 +402,7 @@ $(function () { mch_order_id:param.mch_order_id }; alert("rpay_order_info: nonce_str:"+param.nonce_str+"rpay_order_id:"+param.rpay_order_id+"mch_order_id:"+param.mch_order_id); - window.RPayPlus.send('pay', order, function(data){ - alert('this is callback from native and data='+JSON.stringify(data)); - }); + window.RPayPlus.send('pay', order, null); } function back(){ @@ -461,5 +436,5 @@ $(function () { queryOrder(data); }); } - getUserId(); + getUserId();*/ }); \ No newline at end of file From 1987cc09f80c130cbeaf8233876fa1b1487a3f92 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 17 Sep 2018 16:13:21 +0800 Subject: [PATCH 14/35] update merchant --- .../system/SysRpayMerchantApplyMapper.java | 26 +++++ .../manage/merchants/core/ClientManager.java | 5 + .../core/impls/ClientManagerImpl.java | 104 ++++++++++++------ .../web/PartnerManageController.java | 10 ++ .../static/payment/partner/partner-manage.js | 17 ++- .../templates/partner_payment_info.html | 8 ++ .../templates/sub_merchant_id_apply.html | 74 ++++++++++--- 7 files changed, 199 insertions(+), 45 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java new file mode 100644 index 000000000..9aa1cdbff --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java @@ -0,0 +1,26 @@ +package au.com.royalpay.payment.manage.mappers.system; + +import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; +import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Created by yangluo on 2017-03-14. + */ +@AutoMapper(tablename = "sys_rpay_merchant_apply",pkName = "merchant_app_id") +public interface SysRpayMerchantApplyMapper { + @AutoSql(type = SqlType.SELECT) + List listRpayMerchantApplices(@Param("client_id") int client_id, PageBounds pageBounds); + + @AutoSql(type = SqlType.INSERT) + void insertRpayMerchantApply(JSONObject params); + + @AutoSql(type = SqlType.SELECT) + List selectByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName); + +} 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 7c0e982ea..0604c11e3 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 @@ -60,6 +60,9 @@ public interface ClientManager { @Transactional void updateClientPaymentConfig(JSONObject manager, String clientMoniker, JSONObject subMerchantInfo); + @Transactional + void updateClientRpayPaymentConfig(JSONObject manager, String clientMoniker, JSONObject rpaySubMerchantInfo); + @Transactional void updateAliSubMerchantId(JSONObject manager, String clientMoniker, JSONObject aliSubMerchantInfo); @@ -296,6 +299,8 @@ public interface ClientManager { List listSubMerchantIdApplys(JSONObject manager, String clientMoniker); + List listRpaySubMerchantIdApplys(JSONObject manager, String clientMoniker); + String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply,JSONObject manager); List listMerchantIds(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 7a853e253..4defc9826 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 @@ -25,24 +25,7 @@ import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper; import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper; import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientAuditProcessMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper; -import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; -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.ClientsContractMapper; -import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper; -import au.com.royalpay.payment.manage.mappers.system.MailSendMapper; -import au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper; -import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; -import au.com.royalpay.payment.manage.mappers.system.OrgMapper; -import au.com.royalpay.payment.manage.mappers.system.PermissionPartnerModuleMapper; -import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper; +import au.com.royalpay.payment.manage.mappers.system.*; import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder; import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; @@ -262,6 +245,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private SysWxMerchantApplyMapper sysWxMerchantApplyMapper; @Resource + private SysRpayMerchantApplyMapper sysRpayMerchantApplyMapper; + @Resource private SpringTemplateEngine thymeleaf; @Resource private DeviceManager deviceManager; @@ -770,6 +755,40 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientInfoCacheSupport.clearClientCache(clientId); } + @Override + public void updateClientRpayPaymentConfig(JSONObject manager, String clientMoniker, JSONObject rpaySubMerchantInfo) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + JSONObject update = new JSONObject(); + int clientId = client.getIntValue("client_id"); + String originSubMerchantId = client.getString("rpay_enterprise_id"); + update.put("client_id", clientId); + String subMerchantId = rpaySubMerchantInfo.getString("rpay_enterprise_id"); + update.put("rpay_enterprise_id", subMerchantId); + try { + recordSubMerchantLog(client, rpaySubMerchantInfo, manager); + } catch (Exception e) { + logger.error("记录log_client_sub_merchant_id失败", e); + } + clientMapper.update(update); + List children = clientMapper.listChildClients(clientId); + for (JSONObject child : children) { + if (Objects.equals(child.getString("rpay_enterprise_id"), originSubMerchantId)) { + update.put("client_id", child.getIntValue("client_id")); + try { + recordSubMerchantLog(child, rpaySubMerchantInfo, manager); + } catch (Exception e) { + logger.error("记录log_client_sub_merchant_id失败", e); + } + clientMapper.update(update); + } + } + clientInfoCacheSupport.clearClientCache(clientId); + } + @Override public void updateAliSubMerchantId(JSONObject manager, String clientMoniker, JSONObject aliSubMerchantInfo) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -3513,6 +3532,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return null; } + @Override + public List listRpaySubMerchantIdApplys(JSONObject manager, String clientMoniker) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkOrgPermission(manager, client); + List applices = sysRpayMerchantApplyMapper.listRpayMerchantApplices(client.getInteger("client_id"), + new PageBounds(Order.formString("create_time.desc"))); + if (!applices.isEmpty()) { + return applices; + } + return null; + } + @Override @CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker") public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply, JSONObject manager) { @@ -3548,22 +3582,30 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } checkOrgPermission(manager, client); - SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class); - subRpayMerchantInfo.CheckEmpty(); - rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo); - - logger.debug("访问成功,返回的信息是: " ); - - - - // String sub_merchant_id = elem.elementText("sub_mch_id"); -/* if (StringUtils.isNotEmpty(sub_merchant_id)) { - + List selectByshortName = sysRpayMerchantApplyMapper.selectByShortName(client.getIntValue("client_id"),client.getString("short_name")); + if (selectByshortName.size()>0) { + throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息(请避免和Rpay+商务号列表内的Company Short Name重复)"); + } - } else { + SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class); + subRpayMerchantInfo.CheckEmpty(); + JSONObject rpayMerchantInfo = rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo); + + if (rpayMerchantInfo != null) { + JSONObject merchantApply = new JSONObject(); + merchantApply.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id")); + merchantApply.put("client_id", client.getString("client_id")); + merchantApply.put("create_time", new Date()); + merchantApply.put("operator", manager.getString("display_name")); + merchantApply.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId")); + merchantApply.put("business_category", client.getString("royalpayindustry")); + merchantApply.put("merchant_shortname", client.getString("short_name")); + sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantApply); + }else { throw new BadRequestException("请求失败"); - }*/ + } + return null; } 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 aa40c3310..c228f5995 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 @@ -155,6 +155,11 @@ public class PartnerManageController { clientManager.updateClientPaymentConfig(manager, clientMoniker, subMerchantInfo); } + @ManagerMapping(value = "/{clientMoniker}/rpay_payment_config", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public void updatePartnerRpayPaymentConfig(@PathVariable String clientMoniker, @RequestBody JSONObject rpaySubMerchantInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.updateClientRpayPaymentConfig(manager, clientMoniker, rpaySubMerchantInfo); + } + @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); @@ -518,6 +523,11 @@ public class PartnerManageController { return clientManager.listSubMerchantIdApplys(manager, clientMoniker); } + @ManagerMapping(value = "/{clientMoniker}/list_rpay_sub_applices", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.ADMIN}) + public List listRpaySubMerchantIdApplys(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return clientManager.listRpaySubMerchantIdApplys(manager, clientMoniker); + } + @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); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 63c39ada0..b855dae98 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3084,6 +3084,9 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_sub_applices', {params: {}}).then(function (resp) { $scope.subMerchantInfos = resp.data; }); + $http.get('/sys/partners/' + $scope.partner.client_moniker + '/list_rpay_sub_applices', {params: {}}).then(function (resp) { + $scope.subRpayMerchantInfos = resp.data; + }); }; $scope.useSubMerchantId = function (sub_merchant_id) { $http.put('/sys/partners/' + $scope.partner.client_moniker + '/payment_config', {sub_merchant_id: sub_merchant_id}).then(function (resp) { @@ -3097,6 +3100,18 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) }); } + $scope.useRpaySubMerchantId = function (sub_merchant_id) { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/rpay_payment_config', {rpay_enterprise_id: sub_merchant_id}).then(function (resp) { + commonDialog.alert({ + title: 'Success', + content: 'Modify Rpay+ Sub Merchant ID successfully', + type: 'success' + }); + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}) + }); + } $scope.applyWxSubMerchantId = function () { $uibModal.open({ templateUrl: '/static/payment/partner/templates/apply_wx_sub_merchant_id.html', @@ -3117,7 +3132,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter $http.post('/sys/partners/' + $scope.partner.client_moniker + '/registRpaySubMerchantId').then(function (resp) { commonDialog.alert({ title: 'Success', - content: 'Modify Wechat Sub Merchant ID successfully', + content: 'Modify Rpay+ Sub Merchant ID successfully', type: 'success' }); $state.reload(); 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 6e6499a34..804ab968b 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 @@ -48,6 +48,14 @@

    +
    + +
    +

    + {{paymentInfo.rpay_enterprise_id||'初始化'}} +

    +
    +
    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 03309be2c..40fc8c119 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 @@ -41,19 +41,6 @@
    -
    -
    -

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

    - -
    -

    List of Sub Merchant Id

    @@ -101,4 +88,65 @@
    + +
    +
    +
    +
    +
    +
    +

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

    + +
    +
    +
    +
    +

    List of Sub Merchant Id

    +
    +
    +
      +
    • + Sub Merchant Id + (当前使用){{id_apply.sub_merchant_id}} +
    • +
    • + Apply Time + +
    • +
    • + Company Short Name + {{id_apply.merchant_shortname | cut:true:20:' ...'}} +
    • +
    • + Business Category + {{id_apply.business_category | partner_royalpay_industry}} +
    • +
    • + Operator + +
    • +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file From d6c4a5aafb0f33b603555397dc67dec1db0ba0cc Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 17 Sep 2018 16:17:41 +0800 Subject: [PATCH 15/35] update modify.sql --- src/db/modify.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/db/modify.sql b/src/db/modify.sql index 50f6f75c6..929d90dc1 100644 --- a/src/db/modify.sql +++ b/src/db/modify.sql @@ -1,3 +1,14 @@ +CREATE TABLE `sys_rpay_merchant_apply` ( + `merchant_app_id` varchar(50) NOT NULL, + `client_id` int(11) NOT NULL, + `merchant_shortname` varchar(20) NOT NULL, + `business_category` varchar(20) NOT NULL, + `sub_merchant_id` varchar(20) DEFAULT NULL, + `create_time` datetime NOT NULL, + `operator` varchar(50) DEFAULT NULL, + PRIMARY KEY (`merchant_app_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=244; + ALTER TABLE `pmt_refunds` MODIFY COLUMN `refund_id` varchar(50) NOT NULL COMMENT '退款编号' FIRST ; From 4d1e4b3aa1568854f645b9113e3a7380eba426d6 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 17 Sep 2018 18:33:58 +0800 Subject: [PATCH 16/35] update revert partner --- .../manage/merchants/core/ClientManager.java | 2 ++ .../merchants/core/impls/ClientManagerImpl.java | 7 +++++++ .../merchants/web/PartnerManageController.java | 5 +++++ .../ui/static/payment/partner/partner-manage.js | 13 +++++++++++++ .../payment/partner/templates/partner_detail.html | 1 + 5 files changed, 28 insertions(+) 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..5e3dd5e9a 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 @@ -222,6 +222,8 @@ public interface ClientManager { void disableClient(String clientMoniker, JSONObject manager); + void revertClient(String clientMoniker, JSONObject manager); + JSONObject getAuthFiles(JSONObject manager, String clientMoniker); void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); 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..04b08a2ff 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 @@ -2636,6 +2636,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, false)); } + @Override + public void revertClient(String clientMoniker, JSONObject manager) { + JSONObject client = clientDetail(manager, clientMoniker); + Assert.notEmpty(client); + clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, true)); + } + @Override public void checkTodo(JSONObject manager, List notices) { if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { 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..084fcfa6b 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 @@ -66,6 +66,11 @@ public class PartnerManageController { clientManager.disableClient(clientMoniker, manager); } + @ManagerMapping(value = "/{clientMoniker}/revert", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) + public void revertClient(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.revertClient(clientMoniker, manager); + } + @ManagerMapping(value = "/{clientMoniker}/qrcode", method = RequestMethod.GET) public JSONObject getQrCodeImg(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QRCodeConfig config) { return clientManager.getQRCode(manager, clientMoniker, config); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 8aced4d4e..fe5586f13 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -763,6 +763,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }) }; + $scope.revertClient = function () { + commonDialog.confirm({ + title: 'Revert Partner', + content: 'Are you sure to Revert ' + $scope.partner.company_name + '?' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/revert').then(function () { + $state.go('^'); + commonDialog.alert({title: 'Revert', content: 'Partner Already Revert', type: 'success'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; $scope.commitToCompliance = function () { commonDialog.confirm({ 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..74d5997c0 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -78,6 +78,7 @@ (已禁用) +
    From da29d53dc9f07ced31eefa2cdee09dc88229a29f Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Mon, 17 Sep 2018 18:48:13 +0800 Subject: [PATCH 17/35] =?UTF-8?q?[Y]=20=E6=96=B0=E5=A2=9E=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E5=95=86=E6=88=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/merchants/core/ClientManager.java | 2 ++ .../merchants/core/impls/ClientManagerImpl.java | 7 +++++++ .../merchants/web/PartnerManageController.java | 5 +++++ .../ui/static/payment/partner/partner-manage.js | 13 +++++++++++++ .../payment/partner/templates/partner_detail.html | 1 + 5 files changed, 28 insertions(+) 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..5e3dd5e9a 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 @@ -222,6 +222,8 @@ public interface ClientManager { void disableClient(String clientMoniker, JSONObject manager); + void revertClient(String clientMoniker, JSONObject manager); + JSONObject getAuthFiles(JSONObject manager, String clientMoniker); void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); 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..04b08a2ff 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 @@ -2636,6 +2636,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, false)); } + @Override + public void revertClient(String clientMoniker, JSONObject manager) { + JSONObject client = clientDetail(manager, clientMoniker); + Assert.notEmpty(client); + clientModifySupport.processClientModify(new DisableModify(manager, clientMoniker, true)); + } + @Override public void checkTodo(JSONObject manager, List notices) { if (ManagerRole.OPERATOR.hasRole(manager.getIntValue("role"))) { 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..084fcfa6b 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 @@ -66,6 +66,11 @@ public class PartnerManageController { clientManager.disableClient(clientMoniker, manager); } + @ManagerMapping(value = "/{clientMoniker}/revert", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) + public void revertClient(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.revertClient(clientMoniker, manager); + } + @ManagerMapping(value = "/{clientMoniker}/qrcode", method = RequestMethod.GET) public JSONObject getQrCodeImg(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, QRCodeConfig config) { return clientManager.getQRCode(manager, clientMoniker, config); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 8aced4d4e..fe5586f13 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -763,6 +763,19 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }) }) }; + $scope.revertClient = function () { + commonDialog.confirm({ + title: 'Revert Partner', + content: 'Are you sure to Revert ' + $scope.partner.company_name + '?' + }).then(function () { + $http.put('/sys/partners/' + $scope.partner.client_moniker + '/revert').then(function () { + $state.go('^'); + commonDialog.alert({title: 'Revert', content: 'Partner Already Revert', type: 'success'}); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; $scope.commitToCompliance = function () { commonDialog.confirm({ 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..74d5997c0 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -78,6 +78,7 @@ (已禁用) +
    From deebb88a2ca914b49748f93ec6a3cde24177ccb0 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Mon, 17 Sep 2018 20:42:31 +0800 Subject: [PATCH 18/35] update --- src/main/ui/static/lib/rpay/rpay_jssdk.js | 2 +- .../ui/static/templates/rpay/v1/payment.js | 70 ++++++++++++------- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/src/main/ui/static/lib/rpay/rpay_jssdk.js b/src/main/ui/static/lib/rpay/rpay_jssdk.js index 4bc92ae54..e3f48ea99 100644 --- a/src/main/ui/static/lib/rpay/rpay_jssdk.js +++ b/src/main/ui/static/lib/rpay/rpay_jssdk.js @@ -21,7 +21,7 @@ $(function (){ if(isiOS){ window.webkit.messageHandlers.rpayplus.postMessage(msg); } else{ - //rpayplus.send(msg); + rpayplus.send(msg); } }, diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index c42004284..8df8657e5 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -3,21 +3,21 @@ */ $(function () { 'use strict'; - // document.querySelector('body').addEventListener('touchmove', function (e) { - // if (!document.querySelector('.coupons').contains(e.target)) { - // e.preventDefault(); - // } - // }) + document.querySelector('body').addEventListener('touchmove', function (e) { + if (!document.querySelector('.coupons').contains(e.target)) { + e.preventDefault(); + } + }) var dataCache = {price: '0', coupons: [], coupon_groups: {}}; var exchangeRate = parseFloat(window.exchange_rate); - // if (window.AlipayJSBridge) { - // AlipayJSBridge.call('hideOptionMenu'); - // } else { - // document.addEventListener('AlipayJSBridgeReady', function () { - // AlipayJSBridge.call('hideOptionMenu'); - // }, false); - // } + if (window.AlipayJSBridge) { + AlipayJSBridge.call('hideOptionMenu'); + } else { + document.addEventListener('AlipayJSBridgeReady', function () { + AlipayJSBridge.call('hideOptionMenu'); + }, false); + } dataCache.paying = false; var ctrl = {}; @@ -62,9 +62,11 @@ $(function () { var checked = $(this).is('.checked'); if (checked) { dataCache.coupons.push(couponId); + updatePrice(); } else { var idx = dataCache.coupons.indexOf(couponId); dataCache.coupons.splice(idx, 1); + } }); @@ -87,6 +89,29 @@ $(function () { return price; } + function updatePrice() { + $('#audVal').html(dataCache.price); + var realPrice = dataCache.price; + $('#audValReal').html(realPrice); + var surchargeData = calculateSurcharge(realPrice); + + var price = surchargeData.newPrice || realPrice; + var priceBeforeDiscount = price; + dataCache.discounts = []; + dataCache.tax = surchargeData.tax; + dataCache.surcharge = surchargeData.surcharge; + + $(window.coupons).each(function () { + price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); + }); + dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP); + dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR); + var rate = 'CNY' == window.currency ? 1 : exchangeRate; + var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP); + $('#cnyVal').html(cnyVal); + dataCache.currencyPrice = 'CNY' == window.currency ? Decimal.div(priceBeforeDiscount, exchangeRate).toFixed(2, Decimal.ROUND_FLOOR) : priceBeforeDiscount; + } + function updatePoundageStatus() { $(window.coupons).each(function () { var coupon = this; @@ -117,6 +142,7 @@ $(function () { if (dataCache.price.length == 0) { dataCache.price = '0'; } + updatePrice(); updatePoundageStatus(); } @@ -133,6 +159,7 @@ $(function () { dataCache.price = ''; } dataCache.price += char; + updatePrice(); updatePoundageStatus(); } } @@ -232,7 +259,6 @@ $(function () { dataCache.remark = ''; window.RPayPlus.send("showLoading", null, null); - $.ajax({ url: '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders', method: 'POST', @@ -241,11 +267,7 @@ $(function () { dataType: 'json', success: function (resp) { window.RPayPlus.send("closeLoading", null, null); - // pay(resp); - if (resp.direct_paid) { - location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'; - return; - } + pay(resp,location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'); // if (window.AlipayJSBridge) { // callPayment(); // } else { @@ -287,8 +309,6 @@ $(function () { error: function (jqXhr) { window.RPayPlus.send("closeLoading", null, null); weuiAlert(jqXhr.responseJSON.message); - $('#key_P').removeClass('hidden'); - $('#key_Loading').addClass('hidden'); dataCache.paying = false; } }) @@ -390,19 +410,19 @@ $(function () { } - /* function getUserId(){ + function getUserId(){ window.RPayPlus.send("getUserId", null, function(data){ + window.Rpay.userInfo = data; }); } - function pay(param){ + function pay(param,callback){ var order={ nonce_str:param.nonce_str, rpay_order_id:param.rpay_order_id, mch_order_id:param.mch_order_id }; - alert("rpay_order_info: nonce_str:"+param.nonce_str+"rpay_order_id:"+param.rpay_order_id+"mch_order_id:"+param.mch_order_id); - window.RPayPlus.send('pay', order, null); + window.RPayPlus.send('pay', order, callback); } function back(){ @@ -436,5 +456,5 @@ $(function () { queryOrder(data); }); } - getUserId();*/ + getUserId(); }); \ No newline at end of file From 43ab6507d68b30a147db06050ca68c384e2c4c31 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Tue, 18 Sep 2018 10:09:33 +0800 Subject: [PATCH 19/35] tmp --- src/main/ui/static/templates/rpay/v1/payment.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index 8df8657e5..ba7f27829 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -267,7 +267,15 @@ $(function () { dataType: 'json', success: function (resp) { window.RPayPlus.send("closeLoading", null, null); - pay(resp,location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result'); + + pay(resp,function(data){ + alert(data); + if(data == 'success'){ + location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result' + }else { + alert('Oops,Network fluctuation,please try again later...'); + } + }); // if (window.AlipayJSBridge) { // callPayment(); // } else { From 10a0a6f0ce0e3820fc5021e3a66279cb14684ae7 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Tue, 18 Sep 2018 10:39:28 +0800 Subject: [PATCH 20/35] add rpay --- src/main/ui/static/templates/rpay/v1/payment.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index ba7f27829..74397a9c1 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -267,14 +267,16 @@ $(function () { dataType: 'json', success: function (resp) { window.RPayPlus.send("closeLoading", null, null); - pay(resp,function(data){ - alert(data); if(data == 'success'){ - location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + pay.order_id + '/result' - }else { + location.href = '/api/v1.0/rpay/partners/' + window.client_moniker + '/orders/' + resp.mch_order_id + '/result' + }else if(data == 'fail'){ alert('Oops,Network fluctuation,please try again later...'); } + $('#key_P').removeClass('hidden'); + $('#key_Loading').addClass('hidden'); + dataCache.paying = false; + }); // if (window.AlipayJSBridge) { // callPayment(); @@ -318,6 +320,8 @@ $(function () { window.RPayPlus.send("closeLoading", null, null); weuiAlert(jqXhr.responseJSON.message); dataCache.paying = false; + $('#key_P').removeClass('hidden'); + $('#key_Loading').addClass('hidden'); } }) }); From 2ebe5a2eb7db7c5087e52e213d35c65e54bb7974 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 10:55:27 +0800 Subject: [PATCH 21/35] =?UTF-8?q?[Y]=20=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=9C=B0=E7=90=86=E4=BD=8D=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/core/MerchantLocationService.java | 2 + .../impl/MerchantLocationServiceImpl.java | 87 +++++++++++++++++++ .../dev/web/ClientLocationsController.java | 5 ++ 3 files changed, 94 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java index 61b31104f..56482064a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java @@ -8,6 +8,8 @@ public interface MerchantLocationService { List listMerchantsLocations(PartnerQuery query); + void initClientLocations() throws InterruptedException; + JSONObject getMerchantLocationByMoniker(String clientMoniker); void updateMerchantLocation(JSONObject manager, String clientMoniker, JSONObject geoData); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java index d51cf3041..24ca4aad1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java @@ -5,12 +5,29 @@ import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; import au.com.royalpay.payment.manage.mappers.system.ClientLocationsMapper; import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import cn.yixblog.platform.http.HttpRequestGenerator; +import cn.yixblog.platform.http.HttpRequestResult; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import io.netty.util.internal.ConcurrentSet; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.util.UriComponentsBuilder; import javax.annotation.Resource; +import java.io.IOException; +import java.net.URISyntaxException; import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; @Service public class MerchantLocationServiceImpl implements MerchantLocationService { @@ -28,6 +45,76 @@ public class MerchantLocationServiceImpl implements MerchantLocationService { return clientLocationsMapper.getAllMerchantsLocations(params); } + private Logger logger = LoggerFactory.getLogger(getClass()); + + private static final String GOOGLE_MAPS_API = "https://maps.googleapis.com/maps/api/geocode/json"; + + // private static final String GOOGLE_API_KEY = "AIzaSyBbt7XV5PdXqB2aZeVFAZIzOTO0W6gn_YY"; + private static final String GOOGLE_API_KEY = "AIzaSyDUu6qXRV-j24rSdbPOMfVdTN1-2OfC2o8"; + + private ThreadPoolExecutor pool = new ThreadPoolExecutor(5, 100, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); + private Set failureSet = new ConcurrentSet<>(); + + @Resource + private JdbcTemplate jdbcTemplate; + + @Override + public void initClientLocations() throws InterruptedException { + List> clients = jdbcTemplate.queryForList("select client_id, CONCAT(IFNULL(address,''),' ',IFNULL(suburb,''),' ',IFNULL(state,''),' ',IFNULL(country,'')) as 'address' from royalpay_production.sys_clients where client_id not in (select client_id from royalpay_production.sys_clients_locations) AND client_moniker in ('CUEC','SEA8','SEA0','SEA2','SEA7','HUNT','HLSY','RIMO','TONY','SUCS','SUEM','SUSO','NEW2','NEW1','NEW3','SABO','TSRE','AQSY','JUSC','YMKP','ETAS','EASW','MEET','TDBR','DOUB','NOON','H2GR','LKST','ASON','JSMS','HIDA','DAFR','XANY','VEJE','LUTI','CNHJ','EHPL','YIFA','MRMA','NGMT','BJKC','FORU','CHED','GSAP','ASQI','OMPL','XAMC','HMJC','MGPL','6PHD','MTCS','AIND','KOTN','FDWK','NHKP','GFIT','GHCA','OGPL','RTCB','HOTT','MCRE','YBDW','WPX1','SFPT','WPXM','HOFT','AUID','SUBX','GBTK','PERA','TDCS','DUMP','QJF2','LBWD','HUGG','YINI','CALA','XHJJ','BLUS','SSSS','HEND')"); + final int totalLen = clients.size(); + logger.info("total length:" + totalLen); + for (int i = 0; i < totalLen; i++) { + Map client = clients.get(i); + final JSONObject clientObj = new JSONObject(client); + final int idx = i; + pool.execute(new Runnable() { + @Override + public void run() { + try { + processClient(clientObj, idx, totalLen); + } catch (URISyntaxException e) { + failureSet.add(clientObj.getIntValue("client_id")); + } + } + }); + Thread.sleep(120); + + } + pool.shutdown(); + pool.awaitTermination(5, TimeUnit.HOURS); + System.err.println("Failed clients:" + StringUtils.join(failureSet, ",")); + } + + private void processClient(JSONObject client, int idx, int totalLen) throws URISyntaxException { + String url = UriComponentsBuilder.fromHttpUrl(GOOGLE_MAPS_API) + .queryParam("key", GOOGLE_API_KEY) + .queryParam("address", client.get("address")).toUriString(); + HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.GET); + int clientId = client.getIntValue("client_id"); + logger.info("start processing index " + idx + "/" + totalLen + ",client_id=" + clientId); + HttpRequestResult result = gen.execute(); + if (result.isSuccess()) { + try { + JSONObject address = result.getResponseContentJSONObj(); + System.err.println(address); + JSONArray array1 = address.getJSONArray("results"); + JSONObject aarray2 = (JSONObject) array1.get(0); + JSONObject location = aarray2.getJSONObject("geometry").getJSONObject("location"); + String longitude = location.getString("lng"); + String latitude = location.getString("lat"); + String sql = "INSERT royalpay_production.sys_clients_locations values(replace(uuid(),'-','')," + clientId + ",'" + client.getString("address") + "','" + latitude + "','" + longitude + "','System Init',now())"; + jdbcTemplate.update(sql); + } catch (Exception e) { + logger.error(e.getMessage(), e); + failureSet.add(clientId); + } + } else { + System.err.print(result.getStatusCode()); + failureSet.add(clientId); + } + logger.info("finished index " + idx + "/" + totalLen + ",client_id=" + clientId); + } + @Override public JSONObject getMerchantLocationByMoniker(String clientMoniker) { return clientLocationsMapper.findTheLocationByMerchantCode(clientMoniker); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java index 390fbc040..ec2c600b0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java @@ -22,4 +22,9 @@ public class ClientLocationsController { public List getClientsLocations(PartnerQuery query) { return merchantLocationService.listMerchantsLocations(query); } + + @RequestMapping(value = "/init") + public void initClientLocations() throws InterruptedException { + merchantLocationService.initClientLocations(); + } } From 48c347a55aa35fa145f34e4f9f7e3237c0f2d821 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 10:57:03 +0800 Subject: [PATCH 22/35] =?UTF-8?q?[Y]=20=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=9C=B0=E7=90=86=E4=BD=8D=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/core/MerchantLocationService.java | 2 + .../impl/MerchantLocationServiceImpl.java | 87 +++++++++++++++++++ .../dev/web/ClientLocationsController.java | 5 ++ 3 files changed, 94 insertions(+) diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java index 61b31104f..56482064a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/MerchantLocationService.java @@ -8,6 +8,8 @@ public interface MerchantLocationService { List listMerchantsLocations(PartnerQuery query); + void initClientLocations() throws InterruptedException; + JSONObject getMerchantLocationByMoniker(String clientMoniker); void updateMerchantLocation(JSONObject manager, String clientMoniker, JSONObject geoData); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java index d51cf3041..24ca4aad1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java @@ -5,12 +5,29 @@ import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; import au.com.royalpay.payment.manage.mappers.system.ClientLocationsMapper; import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery; import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import cn.yixblog.platform.http.HttpRequestGenerator; +import cn.yixblog.platform.http.HttpRequestResult; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import io.netty.util.internal.ConcurrentSet; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.util.UriComponentsBuilder; import javax.annotation.Resource; +import java.io.IOException; +import java.net.URISyntaxException; import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; @Service public class MerchantLocationServiceImpl implements MerchantLocationService { @@ -28,6 +45,76 @@ public class MerchantLocationServiceImpl implements MerchantLocationService { return clientLocationsMapper.getAllMerchantsLocations(params); } + private Logger logger = LoggerFactory.getLogger(getClass()); + + private static final String GOOGLE_MAPS_API = "https://maps.googleapis.com/maps/api/geocode/json"; + + // private static final String GOOGLE_API_KEY = "AIzaSyBbt7XV5PdXqB2aZeVFAZIzOTO0W6gn_YY"; + private static final String GOOGLE_API_KEY = "AIzaSyDUu6qXRV-j24rSdbPOMfVdTN1-2OfC2o8"; + + private ThreadPoolExecutor pool = new ThreadPoolExecutor(5, 100, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); + private Set failureSet = new ConcurrentSet<>(); + + @Resource + private JdbcTemplate jdbcTemplate; + + @Override + public void initClientLocations() throws InterruptedException { + List> clients = jdbcTemplate.queryForList("select client_id, CONCAT(IFNULL(address,''),' ',IFNULL(suburb,''),' ',IFNULL(state,''),' ',IFNULL(country,'')) as 'address' from royalpay_production.sys_clients where client_id not in (select client_id from royalpay_production.sys_clients_locations) AND client_moniker in ('CUEC','SEA8','SEA0','SEA2','SEA7','HUNT','HLSY','RIMO','TONY','SUCS','SUEM','SUSO','NEW2','NEW1','NEW3','SABO','TSRE','AQSY','JUSC','YMKP','ETAS','EASW','MEET','TDBR','DOUB','NOON','H2GR','LKST','ASON','JSMS','HIDA','DAFR','XANY','VEJE','LUTI','CNHJ','EHPL','YIFA','MRMA','NGMT','BJKC','FORU','CHED','GSAP','ASQI','OMPL','XAMC','HMJC','MGPL','6PHD','MTCS','AIND','KOTN','FDWK','NHKP','GFIT','GHCA','OGPL','RTCB','HOTT','MCRE','YBDW','WPX1','SFPT','WPXM','HOFT','AUID','SUBX','GBTK','PERA','TDCS','DUMP','QJF2','LBWD','HUGG','YINI','CALA','XHJJ','BLUS','SSSS','HEND')"); + final int totalLen = clients.size(); + logger.info("total length:" + totalLen); + for (int i = 0; i < totalLen; i++) { + Map client = clients.get(i); + final JSONObject clientObj = new JSONObject(client); + final int idx = i; + pool.execute(new Runnable() { + @Override + public void run() { + try { + processClient(clientObj, idx, totalLen); + } catch (URISyntaxException e) { + failureSet.add(clientObj.getIntValue("client_id")); + } + } + }); + Thread.sleep(120); + + } + pool.shutdown(); + pool.awaitTermination(5, TimeUnit.HOURS); + System.err.println("Failed clients:" + StringUtils.join(failureSet, ",")); + } + + private void processClient(JSONObject client, int idx, int totalLen) throws URISyntaxException { + String url = UriComponentsBuilder.fromHttpUrl(GOOGLE_MAPS_API) + .queryParam("key", GOOGLE_API_KEY) + .queryParam("address", client.get("address")).toUriString(); + HttpRequestGenerator gen = new HttpRequestGenerator(url, RequestMethod.GET); + int clientId = client.getIntValue("client_id"); + logger.info("start processing index " + idx + "/" + totalLen + ",client_id=" + clientId); + HttpRequestResult result = gen.execute(); + if (result.isSuccess()) { + try { + JSONObject address = result.getResponseContentJSONObj(); + System.err.println(address); + JSONArray array1 = address.getJSONArray("results"); + JSONObject aarray2 = (JSONObject) array1.get(0); + JSONObject location = aarray2.getJSONObject("geometry").getJSONObject("location"); + String longitude = location.getString("lng"); + String latitude = location.getString("lat"); + String sql = "INSERT royalpay_production.sys_clients_locations values(replace(uuid(),'-','')," + clientId + ",'" + client.getString("address") + "','" + latitude + "','" + longitude + "','System Init',now())"; + jdbcTemplate.update(sql); + } catch (Exception e) { + logger.error(e.getMessage(), e); + failureSet.add(clientId); + } + } else { + System.err.print(result.getStatusCode()); + failureSet.add(clientId); + } + logger.info("finished index " + idx + "/" + totalLen + ",client_id=" + clientId); + } + @Override public JSONObject getMerchantLocationByMoniker(String clientMoniker) { return clientLocationsMapper.findTheLocationByMerchantCode(clientMoniker); diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java b/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java index 390fbc040..ec2c600b0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/web/ClientLocationsController.java @@ -22,4 +22,9 @@ public class ClientLocationsController { public List getClientsLocations(PartnerQuery query) { return merchantLocationService.listMerchantsLocations(query); } + + @RequestMapping(value = "/init") + public void initClientLocations() throws InterruptedException { + merchantLocationService.initClientLocations(); + } } From ee0854002e0af22dd353da6fce12fc44cdcee6db Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 11:12:05 +0800 Subject: [PATCH 23/35] =?UTF-8?q?[Y]=20=E5=95=86=E6=88=B7=E5=9C=B0?= =?UTF-8?q?=E7=90=86=E4=BD=8D=E7=BD=AE=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MerchantLocationServiceImpl.java | 23 ++++++------ .../manage/task/initClientLocationTask.java | 35 +++++++++++++++++++ 2 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/task/initClientLocationTask.java diff --git a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java index 24ca4aad1..8ddac5def 100644 --- a/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/dev/core/impl/MerchantLocationServiceImpl.java @@ -19,7 +19,6 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.util.UriComponentsBuilder; import javax.annotation.Resource; -import java.io.IOException; import java.net.URISyntaxException; import java.util.Date; import java.util.List; @@ -31,10 +30,18 @@ import java.util.concurrent.TimeUnit; @Service public class MerchantLocationServiceImpl implements MerchantLocationService { + private Logger logger = LoggerFactory.getLogger(getClass()); + + private static final String GOOGLE_MAPS_API = "https://maps.googleapis.com/maps/api/geocode/json"; + + private static final String GOOGLE_API_KEY = "AIzaSyDUu6qXRV-j24rSdbPOMfVdTN1-2OfC2o8"; + + private ThreadPoolExecutor pool = new ThreadPoolExecutor(5, 100, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); + + private Set failureSet = new ConcurrentSet<>(); @Resource private ClientLocationsMapper clientLocationsMapper; - @Resource private ClientManager clientManager; @@ -45,22 +52,12 @@ public class MerchantLocationServiceImpl implements MerchantLocationService { return clientLocationsMapper.getAllMerchantsLocations(params); } - private Logger logger = LoggerFactory.getLogger(getClass()); - - private static final String GOOGLE_MAPS_API = "https://maps.googleapis.com/maps/api/geocode/json"; - - // private static final String GOOGLE_API_KEY = "AIzaSyBbt7XV5PdXqB2aZeVFAZIzOTO0W6gn_YY"; - private static final String GOOGLE_API_KEY = "AIzaSyDUu6qXRV-j24rSdbPOMfVdTN1-2OfC2o8"; - - private ThreadPoolExecutor pool = new ThreadPoolExecutor(5, 100, 5, TimeUnit.SECONDS, new LinkedBlockingQueue()); - private Set failureSet = new ConcurrentSet<>(); - @Resource private JdbcTemplate jdbcTemplate; @Override public void initClientLocations() throws InterruptedException { - List> clients = jdbcTemplate.queryForList("select client_id, CONCAT(IFNULL(address,''),' ',IFNULL(suburb,''),' ',IFNULL(state,''),' ',IFNULL(country,'')) as 'address' from royalpay_production.sys_clients where client_id not in (select client_id from royalpay_production.sys_clients_locations) AND client_moniker in ('CUEC','SEA8','SEA0','SEA2','SEA7','HUNT','HLSY','RIMO','TONY','SUCS','SUEM','SUSO','NEW2','NEW1','NEW3','SABO','TSRE','AQSY','JUSC','YMKP','ETAS','EASW','MEET','TDBR','DOUB','NOON','H2GR','LKST','ASON','JSMS','HIDA','DAFR','XANY','VEJE','LUTI','CNHJ','EHPL','YIFA','MRMA','NGMT','BJKC','FORU','CHED','GSAP','ASQI','OMPL','XAMC','HMJC','MGPL','6PHD','MTCS','AIND','KOTN','FDWK','NHKP','GFIT','GHCA','OGPL','RTCB','HOTT','MCRE','YBDW','WPX1','SFPT','WPXM','HOFT','AUID','SUBX','GBTK','PERA','TDCS','DUMP','QJF2','LBWD','HUGG','YINI','CALA','XHJJ','BLUS','SSSS','HEND')"); + List> clients = jdbcTemplate.queryForList("select client_id, CONCAT(IFNULL(address,''),' ',IFNULL(suburb,''),' ',IFNULL(state,''),' ',IFNULL(country,'')) as 'address' from royalpay_production.sys_clients where client_id not in (select client_id from royalpay_production.sys_clients_locations) "); final int totalLen = clients.size(); logger.info("total length:" + totalLen); for (int i = 0; i < totalLen; i++) { diff --git a/src/main/java/au/com/royalpay/payment/manage/task/initClientLocationTask.java b/src/main/java/au/com/royalpay/payment/manage/task/initClientLocationTask.java new file mode 100644 index 000000000..f7b23547c --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/task/initClientLocationTask.java @@ -0,0 +1,35 @@ +package au.com.royalpay.payment.manage.task; + +import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; +import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * Created by wangning on 2018/1/2. + */ +@Component +@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true") +public class initClientLocationTask { + @Resource + private MerchantLocationService merchantLocationService; + @Resource + private SynchronizedScheduler synchronizedScheduler; + + @Scheduled(cron = "0 0 5 * * *") + public void checkBillOrderCheck() { + synchronizedScheduler.executeProcess("manage_task:initClientLocation", 120_000, () -> { + try { + merchantLocationService.initClientLocations(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + }); + + } +} From 09755b167c722d33d1a4a02c37c407f0c3121880 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Tue, 18 Sep 2018 13:45:15 +0800 Subject: [PATCH 24/35] modify --- src/main/resources/application-rpay.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application-rpay.properties b/src/main/resources/application-rpay.properties index 603d8f0e1..5d75a4c07 100644 --- a/src/main/resources/application-rpay.properties +++ b/src/main/resources/application-rpay.properties @@ -1,3 +1,3 @@ app.rpay.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.rpay.rpayPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw4QOJdajtax5/EQ/Tm65tLnaRB3LXrac3jhdOGp+PsQL1tQyRnvKfWDD5qJ2VZ+rSsLUGg//7ubHtuQHFgH8N9BfSDf9PSZLXsgdA0ikAj6/0P+D7VsSAGsw97plXElh3jx1OvKIW46ZFtPgXuotTx1B+4plafhv5JMHMcVYwOGghaDH9Yoh4vaVU6JNw7IWATaycrmAwEns5VVN6uvz2aTYsH8Rb4j2PA8oKW+7ckcF+sCTNJhFK29iHcvLwzGTXrUTaOfk3ZXNhB9g1ou9aolDszUKvj1R7gSoyoq05w6ICno/d0Fu6Oj0H1N36k7OjUt3wX2lm40yu6ymEV6U0QIDAQAB -app.rpay.appId=ae8c8000-d774-42ad-8008-810b55c96aa9 \ No newline at end of file +app.rpay.rpayPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxRx80vX64kSu5nrHbwPX/3SctyFIGrjBEJ9NEBOQPP4KHRQ49QyhVZ1fu7NvtD98n+PGR0ULUrK6S4KsYw6Huaga2RwbSVVkYPFGEFZ70XvjlGSzBG7fkbU8nscWAPOP+k5STD5sOZ35+9ko2H7IBz5RAclREoyB4/JaorQiBrEqS8RmX2TCjtx2lgi9TTcLinMDmULcg5qz44xpn08RwjuVpwRXyWFraxSaF0AcnpqstHON9AEyYanBjpQzR7yvj1IUGPMVNKpu/f4Z0ABvGZ9iAe3lyYESkkZ93ajy4vylY3YQvQsgHAsgazVsg2b25TC6TvAp9xPcaO0U8aoLLQIDAQAB +app.rpay.appId=8850afd2-6183-4cff-83af-9be5ca916e16 \ No newline at end of file From ce3e896e89c074df71ab82a1e02461dd781fc2d2 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Tue, 18 Sep 2018 14:30:00 +0800 Subject: [PATCH 25/35] add rpay merchant --- pom.xml | 4 +++ .../manage/merchants/core/ClientManager.java | 2 ++ .../core/impls/ClientManagerImpl.java | 6 ++-- .../web/PartnerManageController.java | 29 +++++++++++++++---- 4 files changed, 33 insertions(+), 8 deletions(-) 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 0fdaf643b..7808c732b 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 @@ -336,5 +336,7 @@ public interface ClientManager { void sendHfEmailNotice(JSONObject order); + String subRpayMerchantApplication(String clientMoniker, JSONObject manager); + void updateAllPartnerPassword(String clientMoniker, List emails); } 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 24df591c3..9636537e8 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 @@ -7,9 +7,7 @@ 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; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; @@ -44,6 +42,7 @@ import au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper; import au.com.royalpay.payment.manage.mappers.system.ManagerMapper; import au.com.royalpay.payment.manage.mappers.system.OrgMapper; import au.com.royalpay.payment.manage.mappers.system.PermissionPartnerModuleMapper; +import au.com.royalpay.payment.manage.mappers.system.SysRpayMerchantApplyMapper; import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper; import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder; import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; @@ -176,7 +175,6 @@ import javax.annotation.Resource; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import cn.yixblog.platform.http.HttpRequestGenerator; import cn.yixblog.platform.http.HttpRequestResult; @@ -284,6 +282,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private ClientInfoCacheSupport clientInfoCacheSupport; + @Resource + private RpayApi rpayApi; @Resource private SimpleClientApplyService simpleClientApplyService; @Resource 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 d8ba3cd61..768b1ebcb 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 @@ -1,7 +1,13 @@ package au.com.royalpay.payment.manage.merchants.web; import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; -import au.com.royalpay.payment.manage.merchants.beans.*; +import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; +import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig; +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.beans.PartnerQuery; +import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.RequireManager; @@ -11,17 +17,26 @@ import au.com.royalpay.payment.tools.CommonConsts; 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 com.alibaba.fastjson.JSONObject; + import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.io.IOException; import java.io.OutputStream; import java.util.List; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + /** * Created by yixian on 2016-06-27. */ @@ -566,5 +581,9 @@ public class PartnerManageController { public void switchHfEmailNotice(@PathVariable String clientMoniker, @RequestBody JSONObject pass, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { 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); + } } From ea3ba4a5e06301722187497a664414a77043123a Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 14:31:03 +0800 Subject: [PATCH 26/35] fix --- src/main/resources/mybatis-config.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/mybatis-config.xml b/src/main/resources/mybatis-config.xml index e662da9d5..5849c55f3 100644 --- a/src/main/resources/mybatis-config.xml +++ b/src/main/resources/mybatis-config.xml @@ -3,7 +3,6 @@ - From 7ba97fe686a2d9b0b93c016b14c12b1aedf1604d Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 14:54:22 +0800 Subject: [PATCH 27/35] fix properties +rpay --- src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 4b9da4527..f1575e412 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 From 962fb6c1926c10082060240c60df6f14dab57077 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 14:56:46 +0800 Subject: [PATCH 28/35] fix rpay merchant Id displayname --- .../ui/static/payment/partner/templates/partner_detail.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 74d5997c0..91275cb48 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -256,7 +256,7 @@ Product
  • - Wechat Merchant Id Applicaitons + Merchant Id Applicaitons
  • Permissions From cd97e18810b327fbdfaa2089e5ce48a05066bae6 Mon Sep 17 00:00:00 2001 From: kira <164851225@qq.com> Date: Tue, 18 Sep 2018 15:35:05 +0800 Subject: [PATCH 29/35] maven --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cfb6e206d..adaacec07 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ au.com.royalpay.payment payment-parent - 0.2.0-dev + 0.2.0 4.0.0 From aea70ff8282e1712dcfe6260e12c5f25f999f046 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 16:28:24 +0800 Subject: [PATCH 30/35] fix rpay clearing html --- .../templates/partner_bankaccounts.html | 1 + .../partner/templates/partner_new_rate.html | 26 ++++++++++++++++++- .../templates/sub_merchant_id_apply.html | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) 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 49679a2f3..f1e00b160 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_new_rate.html b/src/main/ui/static/payment/partner/templates/partner_new_rate.html index 02f7c1875..c93460d5f 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 @@ -141,7 +141,7 @@
    -
    %
    @@ -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 40fc8c119..95381f8dd 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 @@ -95,7 +95,7 @@
    -

    +

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

    From 6cd99c841c14beae685fbafb7a6ca0da14924c12 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 18 Sep 2018 18:36:39 +0800 Subject: [PATCH 31/35] fix merchant --- .../payment/manage/mappers/system/ClientMapper.java | 3 +++ .../mappers/system/SysRpayMerchantApplyMapper.java | 2 +- .../payment/manage/merchants/core/ClientManager.java | 2 +- .../manage/merchants/core/impls/ClientManagerImpl.java | 9 ++++----- .../manage/merchants/web/PartnerManageController.java | 4 ++-- .../payment/partner/templates/sub_merchant_id_apply.html | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index da095448a..f42b842c5 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -99,4 +99,7 @@ public interface ClientMapper { List findByhfPayUrlNotNull(); + @AutoSql(type = SqlType.UPDATE) + void updateRpayEnterpriseId(@Param("client_id") int clientId, @Param("rpay_enterprise_id") String rpayEnterpriseId); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java index 9aa1cdbff..06664dc14 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/SysRpayMerchantApplyMapper.java @@ -21,6 +21,6 @@ public interface SysRpayMerchantApplyMapper { void insertRpayMerchantApply(JSONObject params); @AutoSql(type = SqlType.SELECT) - List selectByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName); + List listByShortName(@Param("client_id") int client_id,@Param("merchant_shortname") String shortName); } 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 7808c732b..3e03074d9 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 @@ -336,7 +336,7 @@ public interface ClientManager { void sendHfEmailNotice(JSONObject order); - String subRpayMerchantApplication(String clientMoniker, JSONObject manager); + void subRpayMerchantApplication(String clientMoniker, JSONObject manager); void updateAllPartnerPassword(String clientMoniker, List emails); } 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 9636537e8..01d570fc5 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 @@ -3598,16 +3598,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public String subRpayMerchantApplication(String clientMoniker, JSONObject manager) { + public void subRpayMerchantApplication(String clientMoniker, JSONObject manager) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); } checkOrgPermission(manager, client); - List selectByshortName = sysRpayMerchantApplyMapper.selectByShortName(client.getIntValue("client_id"),client.getString("short_name")); + List listByshortName = sysRpayMerchantApplyMapper.listByShortName(client.getIntValue("client_id"),client.getString("short_name")); - if (selectByshortName.size()>0) { + if (listByshortName.size()>0) { throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息(请避免和Rpay+商务号列表内的Company Short Name重复)"); } @@ -3625,11 +3625,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid merchantApply.put("business_category", client.getString("royalpayindustry")); merchantApply.put("merchant_shortname", client.getString("short_name")); sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantApply); + clientMapper.updateRpayEnterpriseId(client.getIntValue("client_id"), rpayMerchantInfo.getString("merchantId")); }else { throw new BadRequestException("请求失败"); } - - return null; } @Override 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 768b1ebcb..6d186abbe 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 @@ -582,8 +582,8 @@ 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); + public void subRpayMerchantApplication(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + clientManager.subRpayMerchantApplication(clientMoniker, manager); } } 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 95381f8dd..66ebd8403 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 @@ -95,7 +95,7 @@
    -

    +

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

    From 45fd38b07171eccbeca77989f99c06396117d6f8 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 22:12:44 +0800 Subject: [PATCH 32/35] fix --- src/main/ui/static/templates/rpay/v1/payment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index 74397a9c1..3eb16a976 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -425,6 +425,7 @@ $(function () { function getUserId(){ window.RPayPlus.send("getUserId", null, function(data){ window.Rpay.userInfo = data; + alert(data); }); } From 977849df937900a1e59ee99547e622a57519a01c Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 22:19:32 +0800 Subject: [PATCH 33/35] fix --- src/main/ui/static/templates/rpay/v1/payment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index 3eb16a976..e1aafcf71 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -423,6 +423,7 @@ $(function () { function getUserId(){ + alert(window.RPayPlus); window.RPayPlus.send("getUserId", null, function(data){ window.Rpay.userInfo = data; alert(data); From 90b71373d65d97133e5fa9d2fb065a06e3a9313b Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 22:22:05 +0800 Subject: [PATCH 34/35] fix --- src/main/ui/static/templates/rpay/v1/payment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index e1aafcf71..a1042ab1a 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -425,8 +425,8 @@ $(function () { function getUserId(){ alert(window.RPayPlus); window.RPayPlus.send("getUserId", null, function(data){ - window.Rpay.userInfo = data; alert(data); + window.Rpay.userInfo = data; }); } From 92dd21c447ec954fefd3ca1e51fb0be74b521ad7 Mon Sep 17 00:00:00 2001 From: "taylor.dang" Date: Tue, 18 Sep 2018 22:27:41 +0800 Subject: [PATCH 35/35] fix --- src/main/ui/static/templates/rpay/v1/payment.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/templates/rpay/v1/payment.js b/src/main/ui/static/templates/rpay/v1/payment.js index a1042ab1a..5c5ac358c 100644 --- a/src/main/ui/static/templates/rpay/v1/payment.js +++ b/src/main/ui/static/templates/rpay/v1/payment.js @@ -254,6 +254,7 @@ $(function () { data.customerrate = true; } data.coupons = dataCache.coupons; + data.customerId = window.RpayUserId; data.qrcodeVersion = window.qrcodeVersion; dataCache.remark = ''; @@ -423,10 +424,8 @@ $(function () { function getUserId(){ - alert(window.RPayPlus); window.RPayPlus.send("getUserId", null, function(data){ - alert(data); - window.Rpay.userInfo = data; + window.RpayUserId = data; }); }