|
|
@ -32,6 +32,7 @@ use App\Services\Spectre\AuthenticationValidator as SpectreValidator; |
|
|
|
use App\Services\SimpleFIN\AuthenticationValidator as SimpleFINValidator; |
|
|
|
use Illuminate\Http\JsonResponse; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Support\Facades\Log; |
|
|
|
|
|
|
|
/** |
|
|
|
* Class ServiceController |
|
|
@ -67,18 +68,21 @@ class ServiceController extends Controller |
|
|
|
|
|
|
|
public function validateSimpleFIN(): JsonResponse |
|
|
|
{ |
|
|
|
Log::debug(sprintf('Now in %s', __METHOD__)); |
|
|
|
$validator = new SimpleFINValidator(); |
|
|
|
$result = $validator->validate(); |
|
|
|
|
|
|
|
if ($result->equals(AuthenticationStatus::error())) { |
|
|
|
// send user error:
|
|
|
|
Log::error('Error: Could not validate app key.'); |
|
|
|
return response()->json(['result' => 'NOK']); |
|
|
|
} |
|
|
|
if ($result->equals(AuthenticationStatus::nodata())) { |
|
|
|
// send user error:
|
|
|
|
Log::error('No data: Could not validate app key.'); |
|
|
|
return response()->json(['result' => 'NODATA']); |
|
|
|
} |
|
|
|
|
|
|
|
Log::info('All OK in validateSimpleFIN.'); |
|
|
|
return response()->json(['result' => 'OK']); |
|
|
|
} |
|
|
|
|
|
|
|