|
|
|
@ -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.InvalidShortIdException;
|
|
|
|
|
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.payment.OrderMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
@ -392,7 +393,19 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
|
if (evt == null) {
|
|
|
|
|
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);
|
|
|
|
|
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
|
|
|
|
|
@Transactional
|
|
|
|
|
public void markChargebackStatus(String riskId, JSONObject manager, ChargebackStatus status) {
|
|
|
|
|
RiskEvent risk = getRiskEvent(riskId);
|
|
|
|
|
if (risk == null) {
|
|
|
|
@ -1389,6 +1403,7 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
|
if (status == null || status == ChargebackStatus.PROCESSING) {
|
|
|
|
|
throw new BadRequestException("Invalid status");
|
|
|
|
|
}
|
|
|
|
|
if (risk.getResultType() < 5) {
|
|
|
|
|
riskProcessLogService.addRiskProcessLog(riskId,
|
|
|
|
|
manager.getString("manager_id"),
|
|
|
|
|
manager.getString("display_name"),
|
|
|
|
@ -1396,6 +1411,11 @@ public class RiskBusinessServiceImpl implements RiskBusinessService, ManagerTodo
|
|
|
|
|
RiskResultTypeEnum.ALREADY_HANDLED.getResultType(),
|
|
|
|
|
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() {
|
|
|
|
|