|
|
|
@ -65,6 +65,12 @@ public class MailServiceImp implements MailService {
|
|
|
|
|
private ClientManager clientManager;
|
|
|
|
|
@Value("${app.settle.aes-key}")
|
|
|
|
|
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
|
|
|
|
|
public void sendEmail(NoticeBean noticeBean) {
|
|
|
|
@ -126,8 +132,13 @@ public class MailServiceImp implements MailService {
|
|
|
|
|
if (files.size() > 0) {
|
|
|
|
|
noticeBean.setFiles(files.toString());
|
|
|
|
|
}
|
|
|
|
|
noticeBean.setSenderAddress("info@royalpay.com.au");
|
|
|
|
|
noticeBean.setPassword("Rpay2018");
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -163,8 +174,13 @@ public class MailServiceImp implements MailService {
|
|
|
|
|
mailClients.add(mailClient);
|
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
|
noticeBean.setSenderAddress("info@royalpay.com.au");
|
|
|
|
|
noticeBean.setPassword("Rpay2018");
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
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();
|
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
|
try {
|
|
|
|
@ -194,8 +210,13 @@ public class MailServiceImp implements MailService {
|
|
|
|
|
mailClients.add(mailClient);
|
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
|
noticeBean.setSenderAddress("info@royalpay.com.au");
|
|
|
|
|
noticeBean.setPassword("Rpay2018");
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
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();
|
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
|
try {
|
|
|
|
@ -312,11 +333,20 @@ public class MailServiceImp implements MailService {
|
|
|
|
|
noticeBean.setMailClients(mailClients);
|
|
|
|
|
noticeBean.setContent(content);
|
|
|
|
|
noticeBean.setAttachFiles(attachFiles);
|
|
|
|
|
noticeBean.setSenderAddress("riskcontrol@royalpay.com.au");
|
|
|
|
|
noticeBean.setPassword("RPrisk123");
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
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){
|
|
|
|
|
noticeBean.setSenderAddress("risk@royalpay.com.au");
|
|
|
|
|
noticeBean.setPassword("Tunnelrisk123");
|
|
|
|
|
String riskMailPwdEncrypted = sysConfig.getString("risk.email.password");
|
|
|
|
|
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();
|
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
|