feat(logging): implement dedicated logging for Telepagos events and update logging configuration

This commit is contained in:
2026-08-19 13:37:21 -03:00
parent 16bc657a31
commit d6574bfd0d
7 changed files with 148 additions and 27 deletions

View File

@@ -285,15 +285,21 @@ class IntegrationServiceTest extends TestCase
'https://api.telepagos.com.ar/v2/auth/token' => Http::response([
'status' => 'error',
'message' => 'Invalid credentials',
'token' => 'must-not-be-logged',
], 401),
]);
Log::shouldReceive('channel')->once()->with('telepagos')->andReturnSelf();
Log::shouldReceive('error')
->once()
->with('Telepagos authentication failed: Invalid credentials', \Mockery::on(function ($context) {
return $context['username'] === 'tele_user'
return ! array_key_exists('username', $context)
&& $context['response_status'] === 401
&& $context['response_body'] === ['status' => 'error', 'message' => 'Invalid credentials'];
&& $context['response_body'] === [
'status' => 'error',
'message' => 'Invalid credentials',
'token' => '[REDACTED]',
];
}));
$service = new TelepagosIntegrationService('telepagos');
@@ -442,6 +448,7 @@ class IntegrationServiceTest extends TestCase
], 422),
]);
Log::shouldReceive('channel')->once()->with('telepagos')->andReturnSelf();
Log::shouldReceive('error')
->once()
->with('Telepagos QR generation failed: Importe inválido', \Mockery::on(function ($context) {
@@ -555,6 +562,7 @@ class IntegrationServiceTest extends TestCase
], 404),
]);
Log::shouldReceive('channel')->once()->with('telepagos')->andReturnSelf();
Log::shouldReceive('error')
->once()
->with('Telepagos get cash-in details failed: Cashin no encontrado', \Mockery::on(function ($context) {