risk upload mail template

master
yixian 4 years ago
parent 5b0813612f
commit b4a8d3e9e1

@ -305,7 +305,7 @@ public class MailServiceImp implements MailService {
}
@Override
public String sendRiskEmail(String title, String mailTos, String mailCcs,String mailBcc, String content, List<JSONObject> attachFiles, int order_type) throws URISyntaxException, IOException {
public String sendRiskEmail(String title, String mailTos, String mailCcs, String mailBcc, String content, List<JSONObject> attachFiles, int orderType) throws IOException {
NoticeBean noticeBean = new NoticeBean();
noticeBean.setTitle(title);
List<JSONObject> mailClients = new ArrayList<>();
@ -324,7 +324,7 @@ public class MailServiceImp implements MailService {
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 (orderType == 1 || orderType == 2) {
String riskMailPwdEncrypted = sysConfig.getString("risk.email.password");
Assert.isTrue(StringUtils.isNotEmpty(riskMailPwdEncrypted), "risk mail pwd not configured");
Key riskAesKey = AESCrypt.fromKeyString(Base64.decodeBase64(riskAESKey));
@ -334,12 +334,10 @@ public class MailServiceImp implements MailService {
}
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
HttpRequestResult result = null;
logger.info("===sendEmail===noticeBean:" + JSON.toJSON(noticeBean));
logger.info("===sendEmail===noticeBean:{}", JSON.toJSON(noticeBean));
result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).setTimeout(60_000).execute();
if (result.isSuccess()) {
String mail_id = result.getResponseContentJSONObj().getString("mail_id");
return mail_id;
//System.out.println("send Mail=============="+mail_id);
return result.getResponseContentJSONObj().getString("mail_id");
} else {
throw new ServerErrorException("Error Connection");
}

@ -798,7 +798,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
});
}
private Context getMailContext(JSONObject event) throws IOException {
private Context getMailContext(JSONObject event) {
String clientMoniker = event.getString("client_moniker");
JSONObject client = clientMapper.findClientByMonikerAll(clientMoniker);
if (client == null) {
@ -907,8 +907,8 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
}
switch (event.getIntValue("order_type")) {
case 1:
case 2:
case RISK_ORDER_TYPE_WX:
case RISK_ORDER_TYPE_ALIPAY:
for (String orderId : realOrderIds) {
JSONObject order = orderMapper.findOrderById(orderId, client.getIntValue("client_id"));
if (order == null) {
@ -919,7 +919,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
ctx.setVariable("orders", orders);
ctx.setVariable("title", "Your merchants needs to submit risk materials");
break;
case 3:
case RISK_ORDER_TYPE_RP:
for (String orderId : realOrderIds) {
JSONObject order = tradeLogService.getOrderDetail(new JSONObject(), clientMoniker, orderId, null);
if (order == null) {
@ -936,9 +936,21 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
orders.add(order);
}
ctx.setVariable("orders", orders);
case 4:
case RISK_ORDER_TYPE_WARN:
ctx.setVariable("title", "RoyalPay风控调查 — " + client.getString("short_name"));
break;
case RISK_ORDER_TYPE_CHARGEBACK:
for (String orderId : realOrderIds) {
JSONObject order = orderMapper.findOrderById(orderId, client.getIntValue("client_id"));
if (order == null) {
throw new BadRequestException("Order: " + orderId + " not exists");
}
order.put(ExtParamsUtils.EXT_PARAMS, ExtParamsUtils.getExtParams(order));
orders.add(order);
}
ctx.setVariable("title", "Chargeback Notification from UPay");
ctx.setVariable("orders", orders);
break;
}
return ctx;
}

@ -991,6 +991,7 @@
o.channel,
o.create_time,
o.confirm_time pay_time,
o.ext_params,
format(o.total_amount,2) total_amount,
format(o.display_amount,2) display_amount,
format(o.refund_amount,2) refund_amount,

@ -145,6 +145,74 @@
<p>我司风控系统检测到您短期内后台交易存在异常行为(<span th:if="${warning_order_type==0}" style="background: #FCE824">单人多次大金额交易</span><span th:if="${warning_order_type==1}" style="background: #FCE824">退款频繁</span>),触发平台风控预警,特此提醒:请勿使用平台进行违规交易,一经核查将关闭支付权限。请知悉。<br>
RoyalPay's risk management system has identified abnormal transactions from your records in a short time(<span th:if="${warning_order_type==0}" style="background: #FCE824">Single person pays large sums several times</span><span th:if="${warning_order_type==1}" style="background: #FCE824">frequent refund transactions</span>),which triggered the platform risk control warning. Here reminds: Do not use the platform for illegal transactions. Once verified, the payment authority will be closed. </p>
</div>
<div th:if="${order_type==6}">
<b>Dear <span th:text="${bdNamesStr}" th:if="${is_send_client==0}"></span><span th:text="${client.contact_person}"
th:if="${is_send_client==1}"></span>:</b>
<p>
<span th:text="${hello}"></span><span th:text="${bdNamesStr}" th:if="${is_send_client==0}"></span><span
th:text="${client.contact_person}" th:if="${is_send_client==1}"></span>
由于消费者申请Chargeback请于
<span th:text="${reply_date}" style="background: #FCE824;"></span>
<span style="background: #FCE824;">下午5:00悉尼时间</span>
尽可能提供以下证明材料:
</p>
<p>
Due to customer applied chargeback issue. Please provide as much materials as best for the transaction
before <span style="background: #FCE824;" th:text="${reply_date_english}"></span>(Sydney time).
</p>
<p>1、持卡人签名授权书和/或收据的清晰副本</p>
<p>1. A legible copy of the signed authority and/or receipts from the Cardholder.</p>
<p>2、任何税务发票和/或签署的披露取消政策的副本</p>
<p>2. Copy of any tax invoice/s and/or signed disclosure of cancellation policy.</p>
<p>3、与在线购买的任何数字商品的销售有关的任何交易信息</p>
<p>3. Any transaction Information relating to the sale of any digital goods purchased online.</p>
<p>4、提供的商品/服务的说明和/或交付/收货的证明。(消费者买了什么,商家卖了什么,消费者收没收到货,如何收到的)</p>
<p>4. Description of the goods/services supplied and/or proof of delivery/collection of goods.</p>
<p>5、邮件订单/电话订单交易收据的副本</p>
<p>5. Copy of Mail Order/telephone order transaction receipt.</p>
<p>6、持卡人身份或与持卡人的任何形式的通信包括电子邮件通信。</p>
<p>6. Cardholder identification or any form of communication with the Cardholder, including email
correspondence.</p>
<table style="border: 1.0px solid;border-collapse: collapse;">
<thead>
<tr>
<th style="border: 1.0px solid;border-collapse: collapse;">Order ID</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Amount</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Status</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Create Time</th>
<th style="border: 1.0px solid;border-collapse: collapse;">Card Number</th>
</tr>
</thead>
<tbody>
<tr th:each="order : ${orders}">
<td th:text="${order.order_id}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="AUD+${order.clearing_amount}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.status}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.create_time}" style="border: 1.0px solid;border-collapse: collapse;"></td>
<td th:text="${order.ext_params.card_alias}" style="border: 1.0px solid;border-collapse: collapse;"></td>
</tr>
</tbody>
</table>
<p th:if="${description != null}"><span th:text="${description}"></span></p>
<p>Chargeback将会扣除$40作为Chargeback Fee同时扣除对应订单交易额申诉成功后将返还订单交易额还请及时提交材料。<!--还请按时提供商户材料并直接回复该邮件, --> 感谢,辛苦。</p>
<!--<p>请点击此链接上传所需材料<a th:href="${uploadUrl}"><span th:text="${uploadUrl}"></span></a></p>-->
<p th:if="${is_send_client==1}">材料请通过APP在规定时间内进行上传或请联系BD由BD在后台进行上传。</p>
<p>
Chargeback issue will take $40 for chargeback fee and minus the fee of the transaction. If you win the
chargeback. Transaction amount will be returned to your account. Please be sure to assist the investigation.
Thanks.
</p>
<p th:if="${is_send_client==1}">
The materials can be uploaded by RoyalPay APP within the required time, or contact with BD.
</p>
<p th:if="${is_send_client==0}"><a th:href="${uploadUrl}"
style="color: rgb(255, 255, 255); text-align: center; padding: 12px 10px; 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: #00c0ef; min-width: 150px;"><strong>Submit
Risk Materials</strong></a></p>
</div>
<br>
<a href="https://royalpay-1256684202.cos.ap-chengdu.myqcloud.com/%E9%A3%8E%E6%8E%A7%E6%8C%87%E5%BC%95-%E5%95%86%E6%88%B7.pdf">
<p>了解更多关于我司风控事宜。Click into the link to see more about our risk management work.</p></a>

@ -270,7 +270,7 @@
</button>
<button class="btn btn-success" type="button"
ng-if="orderTypes[riskEvent.order_type].require_result && riskEvent.result_type<5"
ng-click="commitChargebackStatus('DECLINED')">
ng-click="commitChargebackStatus('REJECTED')">
申诉成功
</button>
</div>

Loading…
Cancel
Save