|
|
@ -65,6 +65,12 @@ public class MailServiceImp implements MailService {
|
|
|
|
private ClientManager clientManager;
|
|
|
|
private ClientManager clientManager;
|
|
|
|
@Value("${app.settle.aes-key}")
|
|
|
|
@Value("${app.settle.aes-key}")
|
|
|
|
private String settleAESKey;
|
|
|
|
private String settleAESKey;
|
|
|
|
|
|
|
|
@Value("${app.partner.aes-key}")
|
|
|
|
|
|
|
|
private String partnerAESKey;
|
|
|
|
|
|
|
|
@Value("${app.risk.aes-key}")
|
|
|
|
|
|
|
|
private String riskAESKey;
|
|
|
|
|
|
|
|
@Value("${app.risk.control.aes-key}")
|
|
|
|
|
|
|
|
private String riskControlAESKey;
|
|
|
|
|
|
|
|
|
|
|
|
/* @Override
|
|
|
|
/* @Override
|
|
|
|
public void sendEmail(NoticeBean noticeBean) {
|
|
|
|
public void sendEmail(NoticeBean noticeBean) {
|
|
|
@ -126,8 +132,13 @@ public class MailServiceImp implements MailService {
|
|
|
|
if (files.size() > 0) {
|
|
|
|
if (files.size() > 0) {
|
|
|
|
noticeBean.setFiles(files.toString());
|
|
|
|
noticeBean.setFiles(files.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
noticeBean.setSenderAddress("info@royalpay.com.au");
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
noticeBean.setPassword("Rpay2018");
|
|
|
|
noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
|
|
|
|
|
|
|
|
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
|
|
|
|
|
|
|
|
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
|
|
|
|
|
|
|
|
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
|
|
|
|
|
|
|
|
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
|
|
|
|
|
|
|
|
noticeBean.setPassword(mailPwd);
|
|
|
|
String postUrl = mailHost + "/mail?" + generateMailSignParam();
|
|
|
|
String postUrl = mailHost + "/mail?" + generateMailSignParam();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -163,8 +174,13 @@ public class MailServiceImp implements MailService {
|
|
|
|
mailClients.add(mailClient);
|
|
|
|
mailClients.add(mailClient);
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
noticeBean.setSenderAddress("info@royalpay.com.au");
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
noticeBean.setPassword("Rpay2018");
|
|
|
|
noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
|
|
|
|
|
|
|
|
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
|
|
|
|
|
|
|
|
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
|
|
|
|
|
|
|
|
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
|
|
|
|
|
|
|
|
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
|
|
|
|
|
|
|
|
noticeBean.setPassword(mailPwd);
|
|
|
|
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
|
|
|
|
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -194,8 +210,13 @@ public class MailServiceImp implements MailService {
|
|
|
|
mailClients.add(mailClient);
|
|
|
|
mailClients.add(mailClient);
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
noticeBean.setSenderAddress("info@royalpay.com.au");
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
noticeBean.setPassword("Rpay2018");
|
|
|
|
noticeBean.setSenderAddress(sysConfig.getString("partner.email.address"));
|
|
|
|
|
|
|
|
String mailPwdEncrypted = sysConfig.getString("partner.email.password");
|
|
|
|
|
|
|
|
Assert.isTrue(StringUtils.isNotEmpty(mailPwdEncrypted), "partner mail pwd not configured");
|
|
|
|
|
|
|
|
Key aesKey = AESCrypt.fromKeyString(Base64.decodeBase64(partnerAESKey));
|
|
|
|
|
|
|
|
String mailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(mailPwdEncrypted), aesKey), StandardCharsets.UTF_8);
|
|
|
|
|
|
|
|
noticeBean.setPassword(mailPwd);
|
|
|
|
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
|
|
|
|
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -312,11 +333,20 @@ public class MailServiceImp implements MailService {
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
noticeBean.setAttachFiles(attachFiles);
|
|
|
|
noticeBean.setAttachFiles(attachFiles);
|
|
|
|
noticeBean.setSenderAddress("riskcontrol@royalpay.com.au");
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
noticeBean.setPassword("RPrisk123");
|
|
|
|
noticeBean.setSenderAddress(sysConfig.getString("riskControl.email.address"));
|
|
|
|
|
|
|
|
String riskControlMailPwdEncrypted = sysConfig.getString("riskControl.email.password");
|
|
|
|
|
|
|
|
Assert.isTrue(StringUtils.isNotEmpty(riskControlMailPwdEncrypted), "riskControl mail pwd not configured");
|
|
|
|
|
|
|
|
Key riskControlAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskControlAESKey));
|
|
|
|
|
|
|
|
String riskControlMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskControlMailPwdEncrypted), riskControlAesKey), StandardCharsets.UTF_8);
|
|
|
|
|
|
|
|
noticeBean.setPassword(riskControlMailPwd);
|
|
|
|
if(order_type == 1 || order_type == 2){
|
|
|
|
if(order_type == 1 || order_type == 2){
|
|
|
|
noticeBean.setSenderAddress("risk@royalpay.com.au");
|
|
|
|
String riskMailPwdEncrypted = sysConfig.getString("risk.email.password");
|
|
|
|
noticeBean.setPassword("Tunnelrisk123");
|
|
|
|
Assert.isTrue(StringUtils.isNotEmpty(riskMailPwdEncrypted), "risk mail pwd not configured");
|
|
|
|
|
|
|
|
Key riskAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskAESKey));
|
|
|
|
|
|
|
|
String riskMailPwd = new String(AESCrypt.decrypt(Base64.decodeBase64(riskMailPwdEncrypted), riskAesKey), StandardCharsets.UTF_8);
|
|
|
|
|
|
|
|
noticeBean.setSenderAddress(sysConfig.getString("risk.email.address"));
|
|
|
|
|
|
|
|
noticeBean.setPassword(riskMailPwd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
|
|
|
|
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
HttpRequestResult result = null;
|
|
|
|