|
|
@ -5,6 +5,7 @@ import au.com.royalpay.payment.core.beans.ChargebackStatus;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.EmailException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.EmailException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.OrderNotMatchException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.OrderNotMatchException;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.core.utils.ExtParamsUtils;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.AppMessageLogMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.AppMessageLogMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
@ -392,7 +393,19 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
if (evt == null) {
|
|
|
|
if (evt == null) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject order = orderMapper.find(evt.getOrders().get(0).getRealOrderId());
|
|
|
|
|
|
|
|
if (order == null) {
|
|
|
|
|
|
|
|
throw new BadRequestException("Order Not found");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ExtParamsUtils.getExtParamsBooleanValue(order, "chargeback_mark")) {
|
|
|
|
|
|
|
|
throw new BadRequestException("Duplicated chargeback on same order");
|
|
|
|
|
|
|
|
}
|
|
|
|
cardSecureService.submitChargeBackReport(evt);
|
|
|
|
cardSecureService.submitChargeBackReport(evt);
|
|
|
|
|
|
|
|
JSONObject update = new JSONObject();
|
|
|
|
|
|
|
|
update.put("order_id", order.getString("order_id"));
|
|
|
|
|
|
|
|
update.put(ExtParamsUtils.EXT_PARAMS, order.getString(ExtParamsUtils.EXT_PARAMS));
|
|
|
|
|
|
|
|
ExtParamsUtils.putExtParam(update, "chargeback_mark", true);
|
|
|
|
|
|
|
|
orderMapper.update(update);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1378,6 +1391,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
public void markChargebackStatus(String riskId, JSONObject manager, ChargebackStatus status) {
|
|
|
|
public void markChargebackStatus(String riskId, JSONObject manager, ChargebackStatus status) {
|
|
|
|
RiskEvent risk = getRiskEvent(riskId);
|
|
|
|
RiskEvent risk = getRiskEvent(riskId);
|
|
|
|
if (risk == null) {
|
|
|
|
if (risk == null) {
|
|
|
@ -1389,13 +1403,19 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
if (status == null || status == ChargebackStatus.PROCESSING) {
|
|
|
|
if (status == null || status == ChargebackStatus.PROCESSING) {
|
|
|
|
throw new BadRequestException("Invalid status");
|
|
|
|
throw new BadRequestException("Invalid status");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
riskProcessLogService.addRiskProcessLog(riskId,
|
|
|
|
if (risk.getResultType() < 5) {
|
|
|
|
manager.getString("manager_id"),
|
|
|
|
riskProcessLogService.addRiskProcessLog(riskId,
|
|
|
|
manager.getString("display_name"),
|
|
|
|
manager.getString("manager_id"),
|
|
|
|
RiskResultTypeEnum.ALREADY_HANDLED.getRemark(),
|
|
|
|
manager.getString("display_name"),
|
|
|
|
RiskResultTypeEnum.ALREADY_HANDLED.getResultType(),
|
|
|
|
RiskResultTypeEnum.ALREADY_HANDLED.getRemark(),
|
|
|
|
RiskResultTypeEnum.ALREADY_HANDLED.getResultType());
|
|
|
|
RiskResultTypeEnum.ALREADY_HANDLED.getResultType(),
|
|
|
|
cardSecureService.changeChargebackReportStatus(riskId, status);
|
|
|
|
RiskResultTypeEnum.ALREADY_HANDLED.getResultType());
|
|
|
|
|
|
|
|
cardSecureService.changeChargebackReportStatus(riskId, status);
|
|
|
|
|
|
|
|
JSONObject evt = new JSONObject();
|
|
|
|
|
|
|
|
evt.put("risk_id", risk.getRiskId());
|
|
|
|
|
|
|
|
evt.put("result_type", RiskResultTypeEnum.ALREADY_HANDLED.getResultType());
|
|
|
|
|
|
|
|
riskEventMapper.update(evt);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<String> getShopTemplate() {
|
|
|
|
private List<String> getShopTemplate() {
|
|
|
|