|
|
|
@ -5,6 +5,7 @@ import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CalendarMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
|
import au.com.royalpay.payment.manage.settlement.core.ManualSettleSupport;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
|
|
|
|
@ -45,6 +46,8 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
|
|
|
|
|
private ClientAccountMapper clientAccountMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private CalendarMapper calendarMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private ClientManager clientManager;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject requestManualSettle(Date settleTo, String accountId) {
|
|
|
|
@ -76,7 +79,7 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject findCurrentSettle(int clientId, boolean includingUnsettleData) {
|
|
|
|
|
JSONObject client = merchantInfoProvider.getClientInfo(clientId);
|
|
|
|
|
JSONObject client = clientManager.getWithConfig(clientId);
|
|
|
|
|
if (!client.getBooleanValue("manual_settle")) {
|
|
|
|
|
throw new ForbiddenException("Manual Settlement Not Enabled");
|
|
|
|
|
}
|
|
|
|
|