From b4a8d3e9e114be06a141348bafa4ef0b40b0b22c Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 6 Aug 2020 19:41:45 +1000 Subject: [PATCH] risk upload mail template --- .../notice/core/impls/MailServiceImp.java | 10 ++- .../core/impl/RiskBusinessServiceImpl.java | 22 ++++-- .../manage/mappers/payment/OrderMapper.xml | 1 + .../templates/mail/risk_upload_mail.html | 68 +++++++++++++++++++ .../analysis/templates/riskEvent_detail.html | 2 +- 5 files changed, 91 insertions(+), 12 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java index a43030776..aa5b98bb2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/notice/core/impls/MailServiceImp.java @@ -305,7 +305,7 @@ public class MailServiceImp implements MailService { } @Override - public String sendRiskEmail(String title, String mailTos, String mailCcs,String mailBcc, String content, List attachFiles, int order_type) throws URISyntaxException, IOException { + public String sendRiskEmail(String title, String mailTos, String mailCcs, String mailBcc, String content, List attachFiles, int orderType) throws IOException { NoticeBean noticeBean = new NoticeBean(); noticeBean.setTitle(title); List 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"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java index be20cc7aa..f8670482d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/riskbusiness/core/impl/RiskBusinessServiceImpl.java @@ -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; } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml index 9a7735294..b03e0d00d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/OrderMapper.xml @@ -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, diff --git a/src/main/resources/templates/mail/risk_upload_mail.html b/src/main/resources/templates/mail/risk_upload_mail.html index 3cd7b9e38..1b57e10db 100644 --- a/src/main/resources/templates/mail/risk_upload_mail.html +++ b/src/main/resources/templates/mail/risk_upload_mail.html @@ -145,6 +145,74 @@

我司风控系统检测到您短期内后台交易存在异常行为(单人多次大金额交易退款频繁),触发平台风控预警,特此提醒:请勿使用平台进行违规交易,一经核查将关闭支付权限。请知悉。
RoyalPay's risk management system has identified abnormal transactions from your records in a short time(Single person pays large sums several timesfrequent refund transactions),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.

+
+ Dear : +

+ + + 由于消费者申请Chargeback,请于 + + 下午5:00(悉尼时间)前 + 尽可能提供以下证明材料: +

+ +

+ Due to customer applied chargeback issue. Please provide as much materials as best for the transaction + before (Sydney time). +

+ +

1、持卡人签名授权书和/或收据的清晰副本

+

1. A legible copy of the signed authority and/or receipts from the Cardholder.

+

2、任何税务发票和/或签署的披露取消政策的副本

+

2. Copy of any tax invoice/s and/or signed disclosure of cancellation policy.

+

3、与在线购买的任何数字商品的销售有关的任何交易信息

+

3. Any transaction Information relating to the sale of any digital goods purchased online.

+

4、提供的商品/服务的说明和/或交付/收货的证明。(消费者买了什么,商家卖了什么,消费者收没收到货,如何收到的)

+

4. Description of the goods/services supplied and/or proof of delivery/collection of goods.

+

5、邮件订单/电话订单交易收据的副本

+

5. Copy of Mail Order/telephone order transaction receipt.

+

6、持卡人身份或与持卡人的任何形式的通信,包括电子邮件通信。

+

6. Cardholder identification or any form of communication with the Cardholder, including email + correspondence.

+ + + + + + + + + + + + + + + + + + + + +
Order IDAmountStatusCreate TimeCard Number
+

+

Chargeback将会扣除$40作为Chargeback Fee,同时扣除对应订单交易额,申诉成功后将返还订单交易额,还请及时提交材料。 感谢,辛苦。

+ +

材料请通过APP在规定时间内进行上传,或请联系BD,由BD在后台进行上传。

+

+ 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. +

+

+ The materials can be uploaded by RoyalPay APP within the required time, or contact with BD. +

+

Submit + Risk Materials

+

了解更多关于我司风控事宜。Click into the link to see more about our risk management work.

diff --git a/src/main/ui/static/analysis/templates/riskEvent_detail.html b/src/main/ui/static/analysis/templates/riskEvent_detail.html index 673e1e00a..2281b51dd 100644 --- a/src/main/ui/static/analysis/templates/riskEvent_detail.html +++ b/src/main/ui/static/analysis/templates/riskEvent_detail.html @@ -270,7 +270,7 @@