feat(logging): implement dedicated logging for Telepagos events and update logging configuration
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user