@@ -15,6 +15,7 @@ import ru.soune.nocopy.entity.payout.PayoutType;
|
||||
import ru.soune.nocopy.entity.user.AuthToken;
|
||||
import ru.soune.nocopy.entity.user.User;
|
||||
import ru.soune.nocopy.exception.InsufficientFundsException;
|
||||
import ru.soune.nocopy.exception.InvalidPayoutMethodException;
|
||||
import ru.soune.nocopy.exception.NotFoundAuthToken;
|
||||
import ru.soune.nocopy.exception.PendingPayoutExistsException;
|
||||
import ru.soune.nocopy.repository.AuthTokenRepository;
|
||||
@@ -56,7 +57,7 @@ public class PayoutController {
|
||||
try {
|
||||
PayoutRequest payoutRequest = payoutRequestService.createPayoutRequest(user.getId(), request);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(payoutRequest);
|
||||
} catch (InsufficientFundsException | PendingPayoutExistsException e) {
|
||||
} catch (InsufficientFundsException | PendingPayoutExistsException | InvalidPayoutMethodException e) {
|
||||
return ResponseEntity.status(HttpStatus.CONFLICT).body(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,9 +75,6 @@ public class PayoutRequestService {
|
||||
|
||||
balanceService.freezeAmount(user, request.getAmount());
|
||||
|
||||
log.info("Payout requset created: ID={}, user={}, sum={}, status={}",
|
||||
savedRequest.getId(), user.getId(), request.getAmount(), savedRequest.getStatus());
|
||||
|
||||
return savedRequest;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user