master
wangning 7 years ago
parent e17b2ffbae
commit 769d28d28b

@ -8,6 +8,7 @@ import au.com.royalpay.payment.tools.mail.SendMail;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@ -66,15 +67,16 @@ public class MailGunServiceImpl implements MailGunService {
@Override
public void dealDroppedNotify(Map<String, String[]> parameter) throws Exception {
parameter.get("my-custom-data-keys");
String dd = URLDecoder.decode(content, "UTF-8");
Map<String, String> mailgunNotify = getQueryMap(dd);
String myData = mailgunNotify.get("my-custom-data");
String recipient = mailgunNotify.get("recipient");
String [] myDataArr = parameter.get("my-custom-data-keys");
if(ArrayUtils.isEmpty(myDataArr)){
return;
}
String [] recipientArr = parameter.get("recipient");
if(ArrayUtils.isEmpty(recipientArr)){
return;
}
String myData = myDataArr[0];
String recipient = recipientArr[0];
if (StringUtils.isNotEmpty(myData) && StringUtils.isNotEmpty(recipient)) {
JSONObject tmpJSONObject = JSONObject.parseObject(myData);
String[] mailAddresses = recipient.split(",");

@ -29,18 +29,7 @@ public class MailCallBackController {
@RequestMapping(value = "/callback/dropped", method = RequestMethod.POST)
public void contractList(HttpServletRequest req, HttpServletResponse res) throws Exception {
req.getParameterMap().entrySet().forEach(p->{
for (String s : p.getValue()) {
logger.info(p.getKey()+ "-keys:"+s);
}
});
mailService.dealDroppedNotify(req.getParameterMap());
// : my-custom-data-keys:{"id": "2726498862302208"}
// 2018-06-05 12:33:50.146 INFO au.com.royalpay.payment.manage.system.web.MailCallBackController: reason-keys:hardfail
// 2018-06-05 12:33:50.146 INFO au.com.royalpay.payment.manage.system.web.MailCallBackController: recipient-keys:lakjcinwqk123@qq.com
// logger.info("kira"+content);
// mailService.dealDroppedNotify(content);
}
}
Loading…
Cancel
Save