diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java index 9d1dfd0c1..ca14416cc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java @@ -22,6 +22,7 @@ public class ClientPreApplyStep1Bean { @NotEmpty(message = "phoneCodeKey can't be null") private String phoneCodeKey; private String apply_source = "pc"; + private int channel; public JSONObject insertObject() { @@ -84,4 +85,12 @@ public class ClientPreApplyStep1Bean { public void setApply_source(String apply_source) { this.apply_source = apply_source; } + + public int getChannel() { + return channel; + } + + public void setChannel(int channel) { + this.channel = channel; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java index e47105ef4..d3a877528 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java @@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.application.core; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import com.alibaba.fastjson.JSONObject; +import org.apache.catalina.servlet4preview.http.HttpServletRequest; public interface SimpleClientApplyService { void verifyRegisterSMSCode(String codeKey, String phoneNumber); @@ -11,7 +12,7 @@ public interface SimpleClientApplyService { String partnerSignIn(JSONObject account); - String getAndSendSmsCode(String phoneNumber, String nationCode); + String getAndSendSmsCode(String phoneNumber, String nationCode, HttpServletRequest request); String checkOrGenerateRegisterProcessKey(String accountName, String codeKey); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index e61854e5f..2abaa88ee 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -28,6 +28,7 @@ import au.com.royalpay.payment.tools.utils.PasswordUtils; import com.alibaba.fastjson.JSONObject; import com.github.qcloudsms.SmsSingleSender; +import org.apache.catalina.servlet4preview.http.HttpServletRequest; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; @@ -43,10 +44,7 @@ import org.thymeleaf.spring4.SpringTemplateEngine; import java.io.IOException; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Random; +import java.util.*; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -103,6 +101,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @Resource private StringRedisTemplate stringRedisTemplate; private final int REGISTER_CLIENT_TEMPLID = 126978; + private final int REGISTER_CLIENT_TEMPLID_ENGLISH = 346078; private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT"; private final String REGISTER_CLIENT_PROCESS_PREFIX = "REGISTER_CLIENT_PROCESS"; private final String VERIFY_MAIL_PREFIX = "VERIFY_MAIL"; @@ -134,7 +133,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } @Override - public String getAndSendSmsCode(String phoneNumber, String nationCode) { + public String getAndSendSmsCode(String phoneNumber, String nationCode, HttpServletRequest request) { String reidsCheckCodeKey = getRegisterClientRedisKey(phoneNumber); String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); if (StringUtils.isNotEmpty(value)) { @@ -147,7 +146,11 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { String expireMin = "3"; param.add(expireMin); try { - smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); + if(request.getLocales().nextElement().equals(Locale.CHINESE)|| request.getLocales().nextElement().equals(Locale.SIMPLIFIED_CHINESE)){ + smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); + }else{ + smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID_ENGLISH, param, "RoyalPay", "", ""); + } } catch (Exception e) { e.printStackTrace(); throw new ServerErrorException("Phone number is wrong Please try again"); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index 339c1fd20..354ee5d21 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -7,6 +7,7 @@ import au.com.royalpay.payment.tools.env.SysConfigManager; import com.alibaba.fastjson.JSONObject; +import org.apache.catalina.servlet4preview.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -64,8 +65,8 @@ public class SimpleClientApplyController { @RequestMapping(value = "/info/phone/{phone_number}/verify", method = RequestMethod.POST) @ResponseBody - public void getAndSendSmsCode(@PathVariable String phone_number, @RequestParam String nation_code) { - simpleClientApplyService.getAndSendSmsCode(phone_number, nation_code); + public void getAndSendSmsCode(@PathVariable String phone_number, @RequestParam String nation_code, HttpServletRequest request) { + simpleClientApplyService.getAndSendSmsCode(phone_number, nation_code, request); } @RequestMapping(value = "/info/update/{username}", method = RequestMethod.POST) diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodInfo.java b/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodInfo.java index 77dcd0c8e..fe93653b2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodInfo.java +++ b/src/main/java/au/com/royalpay/payment/manage/goods/bean/GoodInfo.java @@ -23,6 +23,7 @@ public class GoodInfo { private int inventory = -1; private String origin; private String type; + private String order_desc; private String description; private List images; // private String image_thumbnail; @@ -130,4 +131,12 @@ public class GoodInfo { public void setActual_cny_price(String actual_cny_price) { this.actual_cny_price = actual_cny_price; } + + public String getOrder_desc() { + return order_desc; + } + + public void setOrder_desc(String order_desc) { + this.order_desc = order_desc; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodManage.java b/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodManage.java index 6f4f1e1b5..5c3f388ef 100644 --- a/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodManage.java +++ b/src/main/java/au/com/royalpay/payment/manage/goods/core/GoodManage.java @@ -18,6 +18,8 @@ public interface GoodManage { @Transactional void updateGoodInfo(JSONObject partner, String goodId, GoodInfo goodInfo) throws Exception; + void updateDisplayInventory(JSONObject partner, String goodId, boolean displayInventory); + @Transactional void delete(JSONObject partner, String goodId); } diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodManageImpl.java b/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodManageImpl.java index 54c6cc17a..1c8ebfb95 100644 --- a/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodManageImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/goods/core/impls/GoodManageImpl.java @@ -105,6 +105,14 @@ public class GoodManageImpl implements GoodManage { goodMapper.update(updateObject); } + @Override + public void updateDisplayInventory(JSONObject partner,String goodId, boolean displayInventory) { + JSONObject good = goodMapper.findGood(goodId); + Assert.notNull(good); + good.put("inventory_display", displayInventory); + goodMapper.update(good); + } + @Override public void delete(JSONObject partner, String goodId) { JSONObject good = goodMapper.findGood(goodId); diff --git a/src/main/java/au/com/royalpay/payment/manage/goods/web/GoodManageController.java b/src/main/java/au/com/royalpay/payment/manage/goods/web/GoodManageController.java index d11424442..54591db38 100644 --- a/src/main/java/au/com/royalpay/payment/manage/goods/web/GoodManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/goods/web/GoodManageController.java @@ -46,7 +46,6 @@ public class GoodManageController { throw new Exception("商户未知!"); } return goodManage.getGoodDetail(goodId); - } @PartnerMapping(value ="/{goodId}",method = RequestMethod.DELETE) public void deleteGood(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String goodId) throws Exception { @@ -65,6 +64,14 @@ public class GoodManageController { } + @PartnerMapping(value = "/{goodId}/inventory_display", method = RequestMethod.PUT) + public void updateDisplayInventory(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, @PathVariable String goodId, @RequestBody JSONObject params) throws Exception { + if (partner == null) { + throw new Exception("商户未知!"); + } + goodManage.updateDisplayInventory(partner, goodId,params.getBooleanValue("inventory_display")); + } + @PartnerMapping(value = "/goodOrders", method = RequestMethod.GET) @ResponseBody public JSONObject listGoodOrders(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner, GoodOrderQuery goodOrderQuery) { diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java new file mode 100644 index 000000000..6f8b5b2e7 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/MerchantSignInfoMapper.java @@ -0,0 +1,21 @@ +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 org.apache.ibatis.annotations.Param; +import org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator; + +@AutoMapper(tablename = "merchant_sign_info", pkName = "client_moniker", keyGenerator = Jdbc3KeyGenerator.class) +public interface MerchantSignInfoMapper { + + @AutoSql(type = SqlType.SELECT) + JSONObject findClientSign(@Param("client_moniker") String clientMoniker); + + @AutoSql(type = SqlType.UPDATE) + void update(JSONObject signInfo); + + @AutoSql(type = SqlType.INSERT) + void insert(JSONObject signInfo); +} 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 ca6a84e24..27451135c 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 @@ -245,6 +245,10 @@ public interface ClientManager { void switchChildEachRefund(JSONObject manager, String clientMoniker, boolean childEachRefund); + void changeGatewayVersion(JSONObject account, boolean enable_v2); + + void changeVerifyIp(JSONObject account, boolean enable_v2); + void changePaymentPage(JSONObject account, String paypad_version); void changeManualSettle(JSONObject account , int client_id, boolean manual_settle,String operator_id,int type,String operation); @@ -291,6 +295,12 @@ public interface ClientManager { void setCustomerSurchargeRate(JSONObject account,String clientMoniker, BigDecimal customer_surcharge_rate); + void setPartnerPublicKeyConfig(JSONObject account, String ipWhitelistConfig); + + void refreshPlatformPublicKeyConfig(JSONObject account); + + void setIpWhitelistConfig(JSONObject account, String ipWhitelistConfig); + void setOrderExpiryConfig(JSONObject account,String clientMoniker, String orderExpiryConfig); void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception; diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java index 065afda01..c27c697c6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientModifySupport.java @@ -1,6 +1,7 @@ package au.com.royalpay.payment.manage.merchants.core; import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; +import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify; /** @@ -11,4 +12,6 @@ public interface ClientModifySupport { void processClientModify(ClientModify clientModify); void processClientConfigModify(ClientConfigModify clientConfigModify); + + void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify); } 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 5ed719bc9..49f951fe1 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 @@ -42,6 +42,7 @@ import au.com.royalpay.payment.manage.support.sms.SmsSender; import au.com.royalpay.payment.manage.system.core.ClientContractService; import au.com.royalpay.payment.manage.system.core.MailGunService; import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; +import au.com.royalpay.payment.tools.codec.RSACrypt; import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; @@ -101,6 +102,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestMethod; import org.thymeleaf.context.Context; import org.thymeleaf.spring4.SpringTemplateEngine; +import sun.misc.BASE64Encoder; import javax.annotation.PostConstruct; import javax.annotation.Resource; @@ -117,10 +119,9 @@ import java.math.RoundingMode; import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.security.InvalidKeyException; -import java.security.InvalidParameterException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; +import java.security.*; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; import java.util.List; import java.util.*; import java.util.concurrent.TimeUnit; @@ -274,6 +275,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private SysClientMapper sysClientMapper; @Resource + private MerchantSignInfoMapper merchantSignInfoMapper; + @Resource private Locker locker; @@ -421,6 +424,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid && sysClientMapper.childClientId(client.getIntValue("client_id")).size() > 0) { client.put("level2_client", 1); } + //gateway V2 + JSONObject partnerGatewaySign = merchantSignInfoMapper.findClientSign(client.getString("client_moniker")); + if (partnerGatewaySign == null) { + client.put("enable_gateway_version2", false); + }else { + client.put("enable_gateway_version2", partnerGatewaySign.getBooleanValue("is_valid")); + client.put("gateway_sign", partnerGatewaySign); + } + return client; } @@ -1897,12 +1909,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } OrgCheckUtils.checkOrgPermission(manager, client); - JSONObject update = new JSONObject(); int clientId = client.getIntValue("client_id"); BigDecimal refundCreditLine = refundLineInfo.getBigDecimal("refund_credit_line"); - update.put("client_id", clientId); - update.put("refund_credit_line", refundCreditLine); - clientMapper.update(update); + client.put("refund_credit_line", refundCreditLine); + clientMapper.update(client); clientInfoCacheSupport.clearClientCache(clientId); } @@ -3212,6 +3222,79 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid clientModifySupport.processClientConfigModify(new PaypadVersionModify(manager, clientMoniker, paypad_version)); } + @Override + public void changeGatewayVersion(JSONObject account, boolean enable_gateway_v2) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + JSONObject gatewaySignInfo = merchantSignInfoMapper.findClientSign(client.getString("client_moniker")); + if (gatewaySignInfo == null) { + JSONObject key = getRsaKey(); + gatewaySignInfo = new JSONObject(); + gatewaySignInfo.put("client_moniker", client.getString("client_moniker")); + gatewaySignInfo.put("platform_public_key", key.getString("public_key")); + gatewaySignInfo.put("platform_private_key", key.getString("private_key")); + gatewaySignInfo.put("is_valid", 0); + gatewaySignInfo.put("creation_by", account.getString("account_id")); + gatewaySignInfo.put("creation_date", new Date()); + gatewaySignInfo.put("last_update_by", account.getString("account_id")); + gatewaySignInfo.put("last_update_date", new Date()); + merchantSignInfoMapper.insert(gatewaySignInfo); + } + clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"),"is_valid" ,enable_gateway_v2)); + } + + @Override + public void changeVerifyIp(JSONObject account, boolean verify_ip) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"),"verify_ip" ,verify_ip)); + } + + @Override + public void setIpWhitelistConfig(JSONObject account, String ipWhitelistConfig) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + if (StringUtils.isNotBlank(ipWhitelistConfig)) { + clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"ip_whitelist", ipWhitelistConfig, "重新设置IP白名单")); + } + } + + @Override + @Transactional + public void refreshPlatformPublicKeyConfig(JSONObject account) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + JSONObject key = getRsaKey(); + clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"platform_public_key",key.getString("public_key"),"重新生成平台公钥")); + clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"),"platform_private_key",key.getString("private_key"),"重新生成平台私钥")); + } + + @Override + public void setPartnerPublicKeyConfig(JSONObject account, String publicKey) { + int clientId = account.getIntValue("client_id"); + JSONObject client = getClientInfo(clientId); + if (client == null) { + throw new InvalidShortIdException(); + } + JSONObject update = new JSONObject(); + update.put("client_id", client.getIntValue("client_id")); + if (StringUtils.isNotBlank(publicKey)) { + clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "mch_public_key", publicKey, "重新设置商户公钥")); + } + } + @Override public void changePaymentSuccessPage(JSONObject manager, String clientMoniker, String paysuccess_version) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -5029,4 +5112,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return null; } + private JSONObject getRsaKey() { + JSONObject key = new JSONObject(); + KeyPair keyPairGen = RSACrypt.generateKeyPairs(); + RSAPublicKey publicKey = (RSAPublicKey) keyPairGen.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPairGen.getPrivate(); + key.put("public_key", new BASE64Encoder().encode(publicKey.getEncoded())); + key.put("private_key", new BASE64Encoder().encode(privateKey.getEncoded())); + return key; + } + } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java index ff81810b5..06b629aa9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientModifySupportImpl.java @@ -2,9 +2,11 @@ package au.com.royalpay.payment.manage.merchants.core.impls; import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper; import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport; import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport; import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; +import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; import au.com.royalpay.payment.manage.merchants.entity.ClientModify; import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; @@ -21,6 +23,8 @@ public class ClientModifySupportImpl implements ClientModifySupport { @Resource private MerchantInfoProvider merchantInfoProvider; @Resource + private MerchantSignInfoMapper merchantSignInfoMapper; + @Resource private ClientInfoCacheSupport clientInfoCacheSupport; @Resource private ClientMapper clientMapper; @@ -40,4 +44,10 @@ public class ClientModifySupportImpl implements ClientModifySupport { int clientId =clientConfigModify.doModify(merchantInfoProvider, clientConfigMapper,clientMapper,mongoTemplate); clientInfoCacheSupport.clearClientCache(clientId); } + + @Override + public void processClientGatewaySignModify(ClientGatewaySignModify clientGatewaySignModify) { + int clientId =clientGatewaySignModify.doModify(merchantInfoProvider, merchantSignInfoMapper,mongoTemplate); + clientInfoCacheSupport.clearClientCache(clientId); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java new file mode 100644 index 000000000..2c72380bf --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/ClientGatewaySignModify.java @@ -0,0 +1,78 @@ +package au.com.royalpay.payment.manage.merchants.entity; + +import au.com.royalpay.payment.manage.mappers.system.MerchantSignInfoMapper; +import au.com.royalpay.payment.manage.merchants.beans.mongo.ClientConfigLog; +import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider; +import au.com.royalpay.payment.tools.utils.id.IdUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Create by yixian at 2018-04-12 16:19 + */ +public abstract class ClientGatewaySignModify { + + private JSONObject account; + + private String clientMoniker; + + public ClientGatewaySignModify(JSONObject account, String clientMoniker) { + this.account = account; + this.clientMoniker = clientMoniker; + } + + protected abstract String business(); + + protected abstract JSONObject getModifyResult(); + + @Transactional + public int doModify(MerchantInfoProvider merchantInfoProvider, MerchantSignInfoMapper merchantSignInfoMapper, MongoTemplate mongoTemplate) { + JSONObject client = merchantInfoProvider.getClientInfoByMoniker(clientMoniker); + JSONObject clientGatewaySign = merchantSignInfoMapper.findClientSign(clientMoniker); + JSONObject modifyResult = getModifyResult(); + try { + saveModifyHistory(clientGatewaySign, modifyResult, mongoTemplate); + }catch (Exception e){ + + } + int clientId = client.getIntValue("client_id"); + modifyResult.put("client_moniker", clientMoniker); + modifyResult.put("last_update_by", account.getString("account_id")); + modifyResult.put("last_update_date", new Date()); + merchantSignInfoMapper.update(modifyResult); + return clientId; + } + + private void saveModifyHistory(JSONObject clientGatewaySign, JSONObject modifyResult, MongoTemplate mongoTemplate) { + if (account == null) { + return; + } + ClientConfigLog clientConfigLog = new ClientConfigLog(); + clientConfigLog.setId(IdUtil.getId()); + clientConfigLog.setBusiness(business()); + clientConfigLog.setClientId(clientGatewaySign.getIntValue("client_id")); + + boolean isPartner = true; + if (StringUtils.isNotEmpty(account.getString("account_id"))) { + isPartner = true; + } + if (StringUtils.isNotEmpty(account.getString("manager_id"))) { + isPartner = false; + } + clientConfigLog.setUserType(isPartner ? "Merchant" : "Manager"); + clientConfigLog.setCreateTime(new Date()); + clientConfigLog.setNewData(modifyResult.toJSONString()); + clientConfigLog.setUserId(isPartner ? account.getString("account_id") : account.getString("manager_id")); + Map beforeModify = modifyResult.keySet().stream().collect(Collectors.toMap(key -> key, clientGatewaySign::get)); + clientConfigLog.setOriginData(JSON.toJSONString(beforeModify)); + clientConfigLog.setUserName(isPartner ? account.getString("display_name") : account.getString("display_name")); + mongoTemplate.save(clientConfigLog); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GatewayInfoModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GatewayInfoModify.java new file mode 100644 index 000000000..ffa7efb8a --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/GatewayInfoModify.java @@ -0,0 +1,34 @@ +package au.com.royalpay.payment.manage.merchants.entity.impls; + +import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; +import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; +import com.alibaba.fastjson.JSONObject; + +/** + * Create by yixian at 2018-04-12 16:43 + */ +public class GatewayInfoModify extends ClientGatewaySignModify { + private String key; + private String value; + private String changeMess; + + + public GatewayInfoModify(JSONObject account, String clientMoniker, String key, String value, String changeMess) { + super(account, clientMoniker); + this.key = key; + this.value = value; + this.changeMess = changeMess; + } + + @Override + protected String business() { + return changeMess; + } + + @Override + protected JSONObject getModifyResult() { + JSONObject modify = new JSONObject(); + modify.put(key, value); + return modify; + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchGatewaySignPermissionModify.java b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchGatewaySignPermissionModify.java new file mode 100644 index 000000000..35eff4b47 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/entity/impls/SwitchGatewaySignPermissionModify.java @@ -0,0 +1,32 @@ +package au.com.royalpay.payment.manage.merchants.entity.impls; + +import au.com.royalpay.payment.manage.merchants.entity.ClientConfigModify; +import au.com.royalpay.payment.manage.merchants.entity.ClientGatewaySignModify; +import com.alibaba.fastjson.JSONObject; + +/** + * Create by yixian at 2018-04-12 16:43 + */ +public class SwitchGatewaySignPermissionModify extends ClientGatewaySignModify { + private String key; + private boolean value; + + public SwitchGatewaySignPermissionModify(JSONObject account, String clientMoniker, String key, boolean value) { + super(account, clientMoniker); + this.key = key; + this.value = value; + } + + @Override + protected String business() { + + return (value?"开启 ":"关闭 ")+key; + } + + @Override + protected JSONObject getModifyResult() { + JSONObject modify = new JSONObject(); + modify.put(key, value); + return modify; + } +} \ No newline at end of file diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index fec469d2f..fd72b9942 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -358,6 +358,37 @@ public class PartnerViewController { return tradeLogService.getOrdersCount(account); } + @PartnerMapping(value = "/switch_gateway_v2", method = RequestMethod.PUT) + @ResponseBody + public void changeGatewayVersion(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.changeGatewayVersion(account, pass.getBooleanValue("enable_gateway_version2")); + } + + @PartnerMapping(value = "/verify_ip", method = RequestMethod.PUT) + @ResponseBody + public void changeVerifyIp(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.changeVerifyIp(account, pass.getBooleanValue("verify_ip")); + } + + @PartnerMapping(value = "/ip_whitelist", method = RequestMethod.PUT) + @ResponseBody + public void setIpWhitelistConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject config) { + clientManager.setIpWhitelistConfig(account, config.getString("ip_whitelist")); + } + + @PartnerMapping(value = "/partner_public_key", method = RequestMethod.PUT) + @ResponseBody + public void setPartnerPublicKeyConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject config) { + clientManager.setPartnerPublicKeyConfig(account, config.getString("partner_public_key")); + } + + @PartnerMapping(value = "/refresh_platform_public_key", method = RequestMethod.PUT) + @ResponseBody + public void refreshPlatformPublicKeyConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.refreshPlatformPublicKeyConfig(account); + } + + @PartnerMapping(value = "/payment_page_version", method = RequestMethod.PUT) @ResponseBody public void changePaymentPage(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html index 6842c7812..fada2f2b6 100644 --- a/src/main/ui/merchant_application.html +++ b/src/main/ui/merchant_application.html @@ -323,6 +323,27 @@ minlength="6" maxlength="12" name="rePassword"> +
+
+ +
+
+
- \ No newline at end of file + diff --git a/src/main/ui/static/data/rp_customer_channel.json b/src/main/ui/static/data/rp_customer_channel.json new file mode 100644 index 000000000..f17cc1094 --- /dev/null +++ b/src/main/ui/static/data/rp_customer_channel.json @@ -0,0 +1,49 @@ +[ + { + "children": [ + { + "children": [], + "label": "谷歌|Google", + "mccCode": "10001" + }, + { + "children": [], + "label": "领英|LinkedIn", + "mccCode": "10002" + }, + { + "children": [], + "label": "微信|Wechat", + "mccCode": "10003" + }, + { + "children": [], + "label": "传单手册|Flyer Manual", + "mccCode": "10004" + }, + { + "children": [], + "label": "其他媒体|Other Media", + "mccCode": "10005" + } + ], + "label": "媒体宣传|Media", + "mccCode": "1" + }, + { + "label": "线下使用体验|Offline Experience", + "mccCode": "2" + }, + { + "label": "朋友介绍|Friend Introduction", + "mccCode": "3" + }, + { + "label": "商户推荐|Merchant Recommendation", + "mccCode": "4" + }, + { + "label": "销售推荐|Sales Recommendation", + "mccCode": "5" + } +] diff --git a/src/main/ui/static/data/rp_industry_apply.json b/src/main/ui/static/data/rp_industry_apply.json index c4d2a917c..07b6ea032 100644 --- a/src/main/ui/static/data/rp_industry_apply.json +++ b/src/main/ui/static/data/rp_industry_apply.json @@ -3,187 +3,187 @@ "children": [ { "children": [], - "label": "机票", + "label": "机票|Air Tickets", "mccCode": "10001" }, { "children": [], - "label": "旅游行业", + "label": "旅游行业|Tourism Industry", "mccCode": "10002" }, { "children": [], - "label": "私人定制旅游", + "label": "私人定制旅游|Private Custom Tour", "mccCode": "10003" }, { "children": [], - "label": "租车", + "label": "租车|Car rental", "mccCode": "10004" }, { "children": [], - "label": "巴士", + "label": "巴士|Bus", "mccCode": "10005" } ], - "label": "旅游出行", + "label": "旅游出行|Travel", "mccCode": "1" }, { "children": [ { "children": [], - "label": "饭店", + "label": "饭店|Restaurant", "mccCode": "20001" }, { "children": [], - "label": "奶茶店", + "label": "奶茶店|Tea Shop", "mccCode": "20002" }, { "children": [], - "label": "烧烤", + "label": "烧烤|Barbecue", "mccCode": "20003" }, { "children": [], - "label": "火锅", + "label": "火锅|Hot Pot", "mccCode": "20004" }, { "children": [], - "label": "Coffee", + "label": "咖啡|Coffee", "mccCode": "20005" }, { "children": [], - "label": "酒吧", + "label": "酒吧|Bar", "mccCode": "20006" } ], - "label": "餐饮", + "label": "餐饮|Food", "mccCode": "2" }, { "children": [ { "children": [], - "label": "公众号服务商", + "label": "公众号服务商|Public Service Provider", "mccCode": "50001" }, { "children": [], - "label": "各种媒体类宣传", + "label": "各种媒体类宣传|Various Media Promotion", "mccCode": "50002" } ], - "label": "传媒", + "label": "传媒|Media", "mccCode": "5", "value": "{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}" }, { "children": [ { - "label": "超市", + "label": "超市|Supermarket", "mccCode": "70001" }, { "children": [], - "label": "服装店", + "label": "服装店|Clothing Store", "mccCode": "70002" }, { "children": [], - "label": "鞋店", + "label": "鞋店|Shoe Store", "mccCode": "70003" },{ "children": [], - "label": "箱包", + "label": "箱包|Luggage", "mccCode": "70005" } ], - "label": "零售", + "label": "零售|Retail", "mccCode": "7" }, { "children": [ { "children": [], - "label": "桌游吧", + "label": "桌游吧|Board Game", "mccCode": "80001" }, { "children": [], - "label": "网吧", + "label": "网吧|Internet Cafe", "mccCode": "80007" } ], - "label": "休闲娱乐", + "label": "休闲娱乐|Leisure and entertainment", "mccCode": "8" }, { "children": [ { "children": [], - "label": "摄影", + "label": "摄影|Photography", "mccCode": "90001" }, { "children": [], - "label": "通讯运营商", + "label": "通讯运营商|Communication Carrier", "mccCode": "90003" }, { "children:":[], - "label":"软件服务", + "label":"软件服务|Software Service", "mccCode":"90005" } ], - "label": "其他服务类", + "label": "其他服务类|Other Service Classes", "mccCode": "9" }, { "children": [ { "children": [], - "label": "Hotel", + "label": "旅馆|Hotel", "mccCode": "100001" }, { "children": [], - "label": "Motel", + "label": "汽车旅馆|Motel", "mccCode": "100002" } ], - "label": "酒店", + "label": "酒店|Hotel", "mccCode": "10" }, { "children": [ { "children": [], - "label": "代购", + "label": "代购|Purchasing", "mccCode": "110001" }, { "children": [], - "label": "物流(大宗出口贸易)", + "label": "物流(大宗出口贸易)|Logistics (Bulk Export Trade)", "mccCode": "110002" }, { "children": [], - "label": "红酒出口", + "label": "红酒出口|Wine Export", "mccCode": "110003" }, { "children": [], - "label": "综合电商", + "label": "综合电商|Integrated E-Commerce", "mccCode": "110004" } ], - "label": "出口贸易", + "label": "出口贸易|Export Trade", "mccCode": "11" } -] \ No newline at end of file +] diff --git a/src/main/ui/static/images/aggregate_qr_board.png b/src/main/ui/static/images/aggregate_qr_board.png index 3e92b6065..f9b882b9d 100644 Binary files a/src/main/ui/static/images/aggregate_qr_board.png and b/src/main/ui/static/images/aggregate_qr_board.png differ diff --git a/src/main/ui/static/images/cbbank_aggregate_qr_board.png b/src/main/ui/static/images/cbbank_aggregate_qr_board.png index 507c73487..2294a235d 100644 Binary files a/src/main/ui/static/images/cbbank_aggregate_qr_board.png and b/src/main/ui/static/images/cbbank_aggregate_qr_board.png differ diff --git a/src/main/ui/static/images/qrboard_royalpay.jpg b/src/main/ui/static/images/qrboard_royalpay.jpg index fd828e1ea..0823667f3 100644 Binary files a/src/main/ui/static/images/qrboard_royalpay.jpg and b/src/main/ui/static/images/qrboard_royalpay.jpg differ diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index f35115004..9318c27de 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -71,6 +71,13 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', }; $scope.loadRoyalpayindustry(); + $scope.loadCustomerChannel = function () { + $http.get('/static/data/rp_customer_channel.json').then(function (resp) { + $scope.customerchannel = resp.data; + }) + }; + $scope.loadCustomerChannel(); + $scope.checkParams = function () { if($scope.partner.contact_phone && $scope.partner.nation_code){ @@ -173,6 +180,12 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', $scope.partner.industry = industry.mccCode; $scope.industryLable = industry.label; }; + + $scope.chooseChannel = function (channel) { + $scope.partner.channel = channel.mccCode; + $scope.channelLable = channel.label; + }; + $scope.searchBankInfo = function (bsb_no) { $scope.initErrorMsg(); if (bsb_no != null && bsb_no != "") { @@ -329,6 +342,9 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', return; } if ($scope.partner.client_pay_type.indexOf('1') >= 0 && $scope.partner.client_pay_type.indexOf('2') >= 0) { + if (!($scope.partner.client_pay_desc instanceof Array)) { + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.split(','); + } var fristDesc = $scope.partner.client_pay_desc[0]; var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; if (parseInt(fristDesc) > 5 || parseInt(lastDesc) < 6) { @@ -345,6 +361,8 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', } if ($scope.partner.client_pay_type instanceof Array) { $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + } + if ($scope.partner.client_pay_desc instanceof Array) { $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); } $http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) { @@ -404,4 +422,4 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', $scope.resError = ''; } -}]); \ No newline at end of file +}]); diff --git a/src/main/ui/static/payment/good/good-manage.js b/src/main/ui/static/payment/good/good-manage.js index d89378dca..0bcb5eead 100644 --- a/src/main/ui/static/payment/good/good-manage.js +++ b/src/main/ui/static/payment/good/good-manage.js @@ -120,6 +120,23 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS $scope.good = good.data; var images = good.data.images; $scope.good.images = images ? JSON.parse(images) : []; + $scope.init = { + displayInventory: false + }; + $scope.switchDisplayInventory = function () { + if (!$scope.good) { + return; + } + if (!$scope.init.displayInventory) { + $scope.init.displayInventory = true; + return; + } + $http.put('/sys/client/goods/' + $scope.good.id + '/inventory_display', {inventory_display: $scope.good.inventory_display}).then(function () { + $state.reload(); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }); + }; $scope.editGood = function () { commonDialog.confirm({ title: 'Edit Good', diff --git a/src/main/ui/static/payment/good/templates/add_good.html b/src/main/ui/static/payment/good/templates/add_good.html index 82d0a5f07..b1b042697 100644 --- a/src/main/ui/static/payment/good/templates/add_good.html +++ b/src/main/ui/static/payment/good/templates/add_good.html @@ -171,6 +171,20 @@
+
+ +
+ +
+

Less Than 20 + Characters(including symbols and spaces)

+
+
+
+
diff --git a/src/main/ui/static/payment/good/templates/good_detail.html b/src/main/ui/static/payment/good/templates/good_detail.html index cca67fd90..222fb9f68 100644 --- a/src/main/ui/static/payment/good/templates/good_detail.html +++ b/src/main/ui/static/payment/good/templates/good_detail.html @@ -73,6 +73,13 @@
+
+ +
+ +
+
@@ -88,6 +95,13 @@

+
+ + +
+

+
+
diff --git a/src/main/ui/static/payment/good/templates/good_edit.html b/src/main/ui/static/payment/good/templates/good_edit.html index d280e96e8..3d385bcce 100644 --- a/src/main/ui/static/payment/good/templates/good_edit.html +++ b/src/main/ui/static/payment/good/templates/good_edit.html @@ -189,7 +189,19 @@
- +
+ +
+ +
+

Less Than 20 + Characters(including symbols and spaces)

+
+
+
diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index cfe98ad3f..34782c5ba 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -349,6 +349,38 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot }; }]); + app.controller('clientResetPartnerPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign', function ($scope, $http,gateway_sign) { + $scope.gateway_sign = angular.copy(gateway_sign); + $scope.uploadPublicKey = function (mch_public_key) { + $scope.errmsg = null; + $http.put('/client/partner_info/partner_public_key', {partner_public_key:mch_public_key}).then(function () { + $scope.$close(); + }, function (resp) { + $scope.errmsg = resp.data.message; + }) + } + }]); + app.controller('clientRefreshPlatformPublicKeyDialogCtrl', ['$scope', '$http', 'gateway_sign','commonDialog', function ($scope, $http,gateway_sign,commonDialog) { + $scope.gateway_sign = angular.copy(gateway_sign); + $scope.copyPublicKey = function() { + var e=document.getElementById("c-cpKey"); + e.select(); + var successful = document.execCommand("Copy"); + if (successful) { + commonDialog.alert({title: 'Success', content: '已复制到剪切板!', type: 'success'}); + }else { + commonDialog.alert({title: 'Error', content: '您的浏览器不支持!请手动复制', type: 'error'}); + } + }; + $scope.refreshPublicKey = function () { + $scope.errmsg = null; + $http.put('/client/partner_info/refresh_platform_public_key').then(function () { + $scope.$close(); + }, function (resp) { + $scope.errmsg = resp.data.message; + }) + } + }]); app.controller('clientResetRefundPwdDialogCtrl', ['$scope', '$http', function ($scope, $http) { $scope.updateRefundPwd = function (refundPwd) { $scope.errmsg = null; @@ -570,6 +602,10 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot $scope.paymentInfo = $scope.partner; $scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate); $scope.qrConfig = {currency: 'AUD'}; + $scope.ctrl = { + switch_gateway_v2: false, + switch_verify_ip: false + }; $scope.clientCopyHfLink = function() { var e=document.getElementById("c-cpbt"); @@ -582,6 +618,91 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot } }; + $scope.loadPartnerPaymentInfo = function () { + $http.get('/client/partner_info').then(function (resp) { + $scope.paymentInfo = resp.data; + }) + }; + + $scope.switchGatewayV2 = function () { + if (!$scope.paymentInfo) { + return; + } + if (!$scope.ctrl.switch_gateway_v2) { + $scope.ctrl.switch_gateway_v2 = true; + return; + } + $http.put('/client/partner_info/switch_gateway_v2', {enable_gateway_version2: $scope.paymentInfo.enable_gateway_version2}).then(function () { + $scope.loadPartnerPaymentInfo(); + }, function (resp) { + commonDialog.alert({ + title: 'failed to change Gateway Version', + content: resp.data.message, + type: 'error' + }) + }) + }; + + $scope.switchVerifyIp = function () { + if (!$scope.paymentInfo.gateway_sign) { + return; + } + if (!$scope.ctrl.switch_verify_ip) { + $scope.ctrl.switch_verify_ip = true; + return; + } + $http.put('/client/partner_info/verify_ip', {verify_ip: $scope.paymentInfo.gateway_sign.verify_ip}).then(function () { + $scope.loadPartnerPaymentInfo(); + }, function (resp) { + commonDialog.alert({ + title: 'failed to change Verify IP', + content: resp.data.message, + type: 'error' + }) + }) + }; + $scope.clientSaveIpWhitelistConfig = function (config) { + $http.put('/client/partner_info/ip_whitelist', {ip_whitelist: config}).then(function () { + $scope.ctrl.editIpWhitelistConfig = false; + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }; + + $scope.resetPartnerPubliKey = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/partner_reset_public_key_dialog.html', + controller: 'clientResetPartnerPublicKeyDialogCtrl', + backdrop: false, + size: 'lg', + resolve: { + gateway_sign: function () { + return $scope.paymentInfo.gateway_sign; + } + } + }).result.then(function () { + commonDialog.alert({title: 'Success!', content: 'Partner Public Key Upload Successfully', type: 'success'}) + $scope.loadPartnerPaymentInfo(); + }) + }; + + $scope.refreshPlatformPubliKey = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/partner_refresh_platform_public_key_dialog.html', + controller: 'clientRefreshPlatformPublicKeyDialogCtrl', + backdrop: false, + size: 'lg', + resolve: { + gateway_sign: function () { + return $scope.paymentInfo.gateway_sign; + } + } + }).result.then(function () { + commonDialog.alert({title: 'Success!', content: 'RoyalPay Public Key Refresh Successfully', type: 'success'}) + $scope.loadPartnerPaymentInfo(); + }) + }; + $scope.resetRefundPwd = function (account) { $uibModal.open({ templateUrl: '/static/payment/partner/templates/partner_reset_refund_pwd_dialog.html', diff --git a/src/main/ui/static/payment/partner/templates/client_payment_info.html b/src/main/ui/static/payment/partner/templates/client_payment_info.html index c9b266d21..623aa5316 100644 --- a/src/main/ui/static/payment/partner/templates/client_payment_info.html +++ b/src/main/ui/static/payment/partner/templates/client_payment_info.html @@ -127,6 +127,78 @@
+
+
Gateway Version 2 +
+ Develop Document: + 中文| + English +
+
+
+
+
+ +
+ +
+
+
+
+ + +
+
+ + +
+
+ +
+ +
+
+
+ +
+

+ {{paymentInfo.gateway_sign.ip_whitelist||'Not Configure'}} + 多个IP用逗号隔开 +

+
+ +
+ +
+
+ +
+
+
+
+
+
+
+
+ +
HF Pay Link
diff --git a/src/main/ui/static/payment/partner/templates/partner_refresh_platform_public_key_dialog.html b/src/main/ui/static/payment/partner/templates/partner_refresh_platform_public_key_dialog.html new file mode 100644 index 000000000..d08cc3800 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/partner_refresh_platform_public_key_dialog.html @@ -0,0 +1,33 @@ + + + + + diff --git a/src/main/ui/static/payment/partner/templates/partner_reset_public_key_dialog.html b/src/main/ui/static/payment/partner/templates/partner_reset_public_key_dialog.html new file mode 100644 index 000000000..4b32a3e0f --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/partner_reset_public_key_dialog.html @@ -0,0 +1,30 @@ + + + + + diff --git a/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java b/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java index 255fad75f..3099e1e35 100644 --- a/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java +++ b/src/test/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImplTest.java @@ -33,7 +33,7 @@ public class SimpleClientApplyServiceImplTest { @Test public void getAndSendSmsCode() { - simpleClientApplyService.getAndSendSmsCode("0451120326","61"); + simpleClientApplyService.getAndSendSmsCode("0451120326","61",null); } @Test @@ -57,4 +57,4 @@ public class SimpleClientApplyServiceImplTest { @Test public void deleteVerifyMailKey() { } -} \ No newline at end of file +}