|
|
|
@ -69,6 +69,7 @@ import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
|
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
|
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
|
|
|
|
|
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.connections.attachment.core.AttachmentClient;
|
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
|
@ -83,6 +84,7 @@ import au.com.royalpay.payment.tools.exceptions.NotFoundException;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.event.WechatExceptionEvent;
|
|
|
|
|
import au.com.royalpay.payment.tools.locale.LocaleSupport;
|
|
|
|
|
import au.com.royalpay.payment.tools.mail.SendMail;
|
|
|
|
|
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
|
|
|
|
|
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
|
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
@ -145,8 +147,10 @@ import java.net.URL;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
@ -260,6 +264,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
private ClientInfoCacheSupport clientInfoCacheSupport;
|
|
|
|
|
@Resource
|
|
|
|
|
private MongoTemplate mongoTemplate;
|
|
|
|
|
@Resource
|
|
|
|
|
private MailGunService mailGunService;
|
|
|
|
|
|
|
|
|
|
private static final String SOURCE_AGREE_FILE = "source_agree_file";
|
|
|
|
|
private static final String CLIENT_BANK_FILE = "client_bank_file";
|
|
|
|
@ -790,7 +796,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (StringUtils.isEmpty(mailTo)) {
|
|
|
|
|
throw new EmailException("Client Contact Email is invalid");
|
|
|
|
|
}
|
|
|
|
|
final List<String> emails = new ArrayList<>();
|
|
|
|
|
final Set<String> emails = new HashSet<>();
|
|
|
|
|
for (JSONObject bd : bds) {
|
|
|
|
|
String email = bd.getString("email");
|
|
|
|
|
if (StringUtils.isNotEmpty(email)) {
|
|
|
|
@ -801,9 +807,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo,
|
|
|
|
|
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content);
|
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, emailId));
|
|
|
|
|
SendMail sendMail = new SendMail();
|
|
|
|
|
Set<String> to = new HashSet<>();
|
|
|
|
|
to.add(mailTo);
|
|
|
|
|
sendMail.setMailTos(to);
|
|
|
|
|
sendMail.setMailCcs(emails);
|
|
|
|
|
sendMail.setTitle("Your RoyalPay Cross-border Payment has been set up");
|
|
|
|
|
sendMail.setContent(content);
|
|
|
|
|
JSONObject mailResult = mailGunService.sendMail(sendMail);
|
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, mailResult.getString("mail_id")));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 0, null));
|
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
|
@ -837,7 +849,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
|
|
|
|
|
|
|
|
|
|
final List<String> emails = new ArrayList<>();
|
|
|
|
|
final Set<String> emails = new HashSet<>();
|
|
|
|
|
for (JSONObject bd : bds) {
|
|
|
|
|
String email = bd.getString("email");
|
|
|
|
|
if (StringUtils.isNotEmpty(email)) {
|
|
|
|
@ -848,9 +860,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
String emailId = mailService.sendEmail("Your Partner Account Has Been Authenticated Successfully", mailTo,
|
|
|
|
|
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content);
|
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, emailId));
|
|
|
|
|
SendMail sendMail = new SendMail();
|
|
|
|
|
Set<String> to = new HashSet<>();
|
|
|
|
|
to.add(mailTo);
|
|
|
|
|
sendMail.setMailTos(to);
|
|
|
|
|
sendMail.setMailCcs(emails);
|
|
|
|
|
sendMail.setTitle("Your Partner Account Has Been Authenticated Successfully");
|
|
|
|
|
sendMail.setContent(content);
|
|
|
|
|
JSONObject mailResult = mailGunService.sendMail(sendMail);
|
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, mailResult.getString("mail_id")));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
|
|
}
|
|
|
|
|