Merge remote-tracking branch 'origin/clientApply' into clientApply

master
yuan 7 years ago
commit 0c393ef0bc

@ -136,7 +136,11 @@
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>com.github.qcloudsms</groupId>
<artifactId>qcloudsms</artifactId>
<version>1.0.3</version>
</dependency>
<!--jpush start -->
<dependency>
<groupId>cn.jpush.api</groupId>

@ -2,9 +2,6 @@ package au.com.royalpay.payment.manage.application.beans;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
import java.util.Date;
/**
* Created by yuan on 2018/5/23.

@ -23,6 +23,8 @@ public interface SimpleClientApplyService {
void deleteVerifyMailKey(String codeKey);
void verifyMail(String address, JSONObject loginAccount);
void updateApplyInfo(ClientPreApplyBean companyBean,String client_moniker);
JSONObject getBankInfo(String bsb_no);

@ -6,18 +6,23 @@ import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.mappers.preapply.SysClientPreMapperMapper;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.signin.beans.LoginInfo;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.system.core.MailGunService;
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.locale.LocaleSupport;
import au.com.royalpay.payment.tools.mail.SendMail;
import au.com.royalpay.payment.tools.utils.PasswordUtils;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
import com.alibaba.fastjson.JSONObject;
import com.github.qcloudsms.SmsSingleSender;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
@ -59,6 +64,9 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
private SpringTemplateEngine thymeleaf;
@Resource
private ClientManager clientManager;
@Resource
private SignInAccountService signInAccountService;
@Resource
private ClientAccountMapper clientAccountMapper;
@ -77,10 +85,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@Resource
private ClientConfigMapper clientConfigMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
private final SmsSingleSender smsSingleSender = new SmsSingleSender(appId, appKey);
private final SmsSingleSender ssender = new SmsSingleSender(appId, appKey);
// TODO: 2018/5/24 kira
private final int REGISTER_CLIENT_TEMPLID = 126008;
private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT";
private final String REGISTER_CLIENT_PROCESS_PREFIX = "REGISTER_CLIENT_PROCESS";
@ -119,7 +127,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
if (StringUtils.isNotEmpty(value)) {
throw new BadRequestException("SMS has been sentPlease check your messages or try again in 3 minutes.");
}
JSONObject sysConfig = sysConfigManager.getSysConfig();
ArrayList<String> param = new ArrayList<>();
String registerClientCode = RandomStringUtils.random(6, true, true);
@ -127,7 +134,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
String expireMin = (String) sysConfig.getOrDefault("sms.verification.code.expire", 3);
param.add(expireMin);
try {
smsSingleSender.sendWithParam(nationCode, phoneNumber, REGISTER_CLIENT_TEMPLID, param, "", "", "");
ssender.sendWithParam(nationCode, phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); //
} catch (Exception e) {
throw new ServerErrorException("System Error");
}
@ -190,7 +197,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
}
}
String key = RandomStringUtils.random(10, true, false);
stringRedisTemplate.boundValueOps(getRegisterClientProcessRedisKey(key)).set(address,1,TimeUnit.HOURS);
stringRedisTemplate.boundValueOps(getVerifyMailRedisKey(key)).set(address, 1, TimeUnit.HOURS);
return key;
}
@ -355,12 +362,28 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
}
return banInfo;
}
@Override
public void verifyMail(String address, JSONObject loginAccount) {
LoginInfo loginInfo = new LoginInfo();
loginInfo.setLoginId(loginAccount.getString("userName"));
loginInfo.setPassword(loginAccount.getString("password"));
JSONObject account = signInAccountService.accountCheck(loginInfo);
JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id"));
if (!address.equals(client.getString("contact_email"))) {
throw new BadRequestException(LocaleSupport.localeMessage("error.login.password"));
}
}
private String getRegisterClientRedisKey(String phoneNumber){
return REGISTER_CLIENT_PREFIX +phoneNumber;
}
private String getRegisterClientProcessRedisKey(String codeKey) {
return REGISTER_CLIENT_PROCESS_PREFIX + codeKey;
}
private String getVerifyMailRedisKey(String codekey) {
return VERIFY_MAIL_PREFIX + codekey;
}

@ -3,8 +3,6 @@ package au.com.royalpay.payment.manage.application.web;
import au.com.royalpay.payment.manage.application.beans.ClientPreApplyBean;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.signin.beans.LoginInfo;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.http.HttpUtils;
@ -23,8 +21,6 @@ import javax.validation.Valid;
public class SimpleClientApplyController {
@Resource
private SimpleClientApplyService simpleClientApplyService;
@Resource
private SignInAccountService signInAccountService;
@RequestMapping(value = "/account/{account_name}", method = RequestMethod.GET)
@ResponseBody
@ -49,7 +45,7 @@ public class SimpleClientApplyController {
@RequestMapping(value = "/account/mail/{address}/verify/{codeKey}/jump", method = RequestMethod.GET)
public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address){
simpleClientApplyService.checkOrGenerateVerifyMailKey(address,codeKey);
ModelAndView view = new ModelAndView("verify_mail");
ModelAndView view = new ModelAndView("mail/register_application");
view.addObject("codeKey", codeKey);
view.addObject("address", address);
return view;
@ -59,10 +55,7 @@ public class SimpleClientApplyController {
@ResponseBody
public void verifyMail(@PathVariable String codeKey, @PathVariable String address,@RequestBody JSONObject account){
simpleClientApplyService.checkOrGenerateVerifyMailKey(address,codeKey);
LoginInfo loginInfo = new LoginInfo();
loginInfo.setLoginId(account.getString("userName"));
loginInfo.setPassword(account.getString("password"));
signInAccountService.accountCheck(loginInfo);
simpleClientApplyService.verifyMail(address,account);
simpleClientApplyService.deleteVerifyMailKey(codeKey);
}

@ -1633,8 +1633,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public String getQrCodeBoard(JSONObject client, QRCodeConfig config,JSONObject account,String plantform) {
// JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
// return merchantInfoProvider.getQrCodeBoard(client, config);
return merchantInfoProvider.getQrCodeBoard(client, config,account,plantform);
return merchantInfoProvider.getQrCodeBoard(client, config);
// return merchantInfoProvider.getQrCodeBoard(client, config,account,plantform);
}
@Override
@ -1658,8 +1658,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
qrboardConfig.put("brandw", "600");
qrboardConfig.put("brandh", "200");
String type = qrboardConfig.getString("type");
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous);
} catch (Exception e) {
throw new ServerErrorException("QR board config not set for current organize", e);
@ -1679,8 +1679,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
JSONObject qrboardConfig = JSON.parseObject(qrBoardConfigString);
String type = qrboardConfig.getString("type");
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
// QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config,mongoTemplate,manager,plantform);
QRBoard board = QRBoardProvider.getQRBoard(type, qrboardConfig, client, config);
board.drawBoardImage(ous);
} catch (Exception e) {
throw new ServerErrorException("QR board config not set for current organize", e);

@ -1,6 +1,6 @@
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.schema-name=royalpay_production
spring.datasource.host=192.168.99.100:3306
spring.datasource.host=192.168.0.49:3306
spring.datasource.url=jdbc:mysql://${spring.datasource.host}/${spring.datasource.schema-name}?useUnicode=true&characterEncoding=utf8&useSSL=false
spring.datasource.username=root
spring.datasource.password=root

@ -16,20 +16,9 @@
</tbody></table>
</td>
</tr>
<tr class="header">
<td align="center">
<h1 style="font-size: 24px; line-height: 1.3em; margin-bottom: 5px;">Register Invitation</h1>
</td>
</tr>
<tr class="content">
<td>
<p style="font-size: 15px; font-weight: normal; line-height: 22px;">Dear Partner, </p>
<p style="font-size: 15px; font-weight: normal; line-height: 22px;">Thank you for registering an account with us!</p>
<p style="font-size: 15px; font-weight: normal; line-height: 22px;">This is a system verification email from RoyalPay. RoyalPay is an exciting platform that makes international payments as easy as local ones.
To get started, click on the button below:</p>
<p style="font-size: 15px; font-weight: normal; line-height: 22px;">Before you can use RoyalPay Cross-border Payment, you need to verify your email address. </p>
</td>
</tr>
@ -39,15 +28,34 @@
<table cellpadding="12" border="0" style="font-family: Lato, 'Lucida Sans', 'Lucida Grande', SegoeUI, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; line-height: 25px; color: #444444; text-align: left;">
<tbody><tr>
<td class="button" style="color: rgb(255, 255, 255); font-size: 16px; line-height: 24px; text-align: center; display: block;">
<a th:href="${url}" style="color: rgb(255, 255, 255); text-align: center; display: block; padding: 12px 20px; height: 100%; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; text-decoration: none; background-color: rgb(43, 136, 217); min-width: 150px;"><strong>Register your account right now!</strong></a>
<a th:href="${url}" style="color: rgb(255, 255, 255); text-align: center; display: block; padding: 12px 20px; height: 100%; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; text-decoration: none; background-color: rgb(43, 136, 217); min-width: 150px;"><strong>Verify mail address</strong></a>
</td>
</tr>
</tbody></table>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<br>
<br>
<p> Once you're ready ro start integrating RoyalPay, we recommend taking a look at our
<a href="https://mpay.royalpay.com.au/docs/en/">docs</a>
<p> if you have any question please contact us</p>
Email: <a href="mailto:info@royalpay.com.au">info@royalpay.com.au</a><br>
Tel: 1300 10 77 50<br>
<div style="width: 40%;padding: 0 15px;float: left;text-align: center;margin-right: 26px;" >
<img style="width: 100%;background-color: black;" src="https://mpay.royalpay.com.au/static/css/img/qr_service.png">
Customer Service
</div>
<div style="width: 40%;padding: 0 15px;float: left;text-align: center;" >
<img style="width: 100%;background-color: black;" src="https://mpay.royalpay.com.au/static/css/img/qr_service.png">
RoyalPay WeChat Official Account
</div>
</td>
</tr>
</tbody>
</table>
</td>

@ -4,37 +4,16 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>RoyalPay | Reset Password</title>
<link rel="apple-touch-icon" sizes="57x57" href="ico/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="ico/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="ico/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="ico/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="ico/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="ico/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="ico/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="ico/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="ico/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="ico/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="ico/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="ico/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="ico/favicon-16x16.png">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.5 -->
<link href="static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="https://mpay.royalpay.com.au/static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="./static/lib/dist/css/AdminLTE.min.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="https://mpay.royalpay.com.au/static/lib/dist/css/AdminLTE.min.css">
<style type="text/css">
#bg {
display: block;
@ -65,8 +44,7 @@
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<p><img src="static/images/rp_logo.svg" style="width:45%"></p>
<a href="index.html"><b>RoyalPay</b></a>
<p><img src="https://mpay.royalpay.com.au/static/images/rp_logo.svg" style="width:45%"></p>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
@ -84,19 +62,12 @@
</div>
<div class="row">
<!-- <div class="form-group col-xs-12">
<input type="text" name="codeKey" class="form-control" style="width: 70%;display: inline"
id="codeKey" placeholder="Verification Code">
<img style="width:30%;display:inline;height: 34px;float: right" id="email-kaptcha"
src="/global/userstatus/captcha-login"
title="点击更换"/>
</div>-->
<div class="col-xs-12 margin-bottom">
<button type="button" id="submitEmail-btn" class="btn btn-success btn-block btn-flat">Submit</button>
</div>
</div>
<p style="font-size: smaller">
文案修改 We need your partner code to confirm your identity information, please enter it. (Your partner code is the same as the first four letters of your order ID.)
We need your user name & password to confirm your identity information, please enter it.
</p>
</form>
@ -105,9 +76,9 @@
</div>
<!-- /.login-box -->
<script src="static/lib/jquery/jquery-2.1.4.min.js"></script>
<script src="https://mpay.royalpay.com.au/static/lib/jquery/jquery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="https://mpay.royalpay.com.au/static/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" data-th-inline="javascript">
$(document).ready(function () {
window.address = /*[[${address}]]*/'';

@ -0,0 +1,60 @@
package au.com.royalpay.payment.manage.application.core.impls;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
@SpringBootTest
@ActiveProfiles({ "dev", "alipay", "wechat", "jd", "bestpay" })
@RunWith(SpringRunner.class)
public class SimpleClientApplyServiceImplTest {
@Resource
private SimpleClientApplyService simpleClientApplyService;
@Test
public void verifyRegisterSMSCode() {
}
@Test
public void newAccount() {
}
@Test
public void partnerSignIn() {
simpleClientApplyService.partnerSignIn(null);
}
@Test
public void getAndSendSmsCode() {
simpleClientApplyService.getAndSendSmsCode("0451120326","61");
}
@Test
public void sendVerifyEmail() {
simpleClientApplyService.sendVerifyEmail("kira.wang@royalpay.com.au", 9);
}
@Test
public void checkOrGenerateRegisterProcessKey() {
}
@Test
public void deleteRegisterProcessKey() {
}
@Test
public void checkOrGenerateVerifyMailKey() {
}
@Test
public void deleteVerifyMailKey() {
}
}

@ -185,7 +185,7 @@ public class CustomerImpressionImplTest {
JSONObject var = new JSONObject();
var.put("client_moniker", client.getString("client_moniker"));
var.put("short_name", client.getString("short_name"));
JSONObject result = mailGunClient.addListMember(client.getString("contact_email"), "merchants@mail.royalpay.com.au", client.getString("contact_person"),
JSONObject result = mailGunClient.addListMember(client.getString("contact_email"), "merchants@mail.royalpay.com.au", client.getString("contact_person"),"",
var);
}

Loading…
Cancel
Save