From b866973d189fea5cf6407ad8b07a1e6f173e3701 Mon Sep 17 00:00:00 2001 From: usarise <7043681+usarise@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:22:31 +0700 Subject: [PATCH] errors descriptions update --- src/Error/Description.php | 8 ++++---- tests/ErrorCodeTest.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Error/Description.php b/src/Error/Description.php index 586a0be..006ef05 100644 --- a/src/Error/Description.php +++ b/src/Error/Description.php @@ -11,18 +11,18 @@ final class Description { public const TEXTS = [ 'missing-input-secret' => 'The secret parameter was not passed', 'invalid-input-secret' => 'The secret parameter was invalid or did not exist', - 'missing-input-response' => 'The response parameter was not passed', - 'invalid-input-response' => 'The response parameter is invalid or has expired', + 'missing-input-response' => 'The response parameter (token) was not passed', + 'invalid-input-response' => 'The response parameter (token) is invalid or has expired. Most of the time, this means a fake token has been used. If the error persists, contact customer support', 'invalid-widget-id' => 'The widget ID extracted from the parsed site secret key was invalid or did not exist', 'invalid-parsed-secret' => 'The secret extracted from the parsed site secret key was invalid', 'bad-request' => 'The request was rejected because it was malformed', - 'timeout-or-duplicate' => 'The response parameter has already been validated before', + 'timeout-or-duplicate' => 'The response parameter (token) has already been validated before. This means that the token was issued five minutes ago and is no longer valid, or it was already redeemed', 'internal-error' => 'An internal error happened while validating the response. The request can be retried', 'challenge-timeout' => 'Challenge timeout', 'hostname-mismatch' => 'Expected hostname did not match', 'action-mismatch' => 'Expected action did not match', 'cdata-mismatch' => 'Expected cdata did not match', 'invalid-json' => 'Invalid JSON received', - 'unknown-error' => 'Not a success, but no error codes received!', + 'unknown-error' => 'Not a success, but no error codes received', ]; } diff --git a/tests/ErrorCodeTest.php b/tests/ErrorCodeTest.php index d611077..c96a0e2 100644 --- a/tests/ErrorCodeTest.php +++ b/tests/ErrorCodeTest.php @@ -26,19 +26,19 @@ public function testToDescriptionFull(): void { [ 'The secret parameter was not passed', 'The secret parameter was invalid or did not exist', - 'The response parameter was not passed', - 'The response parameter is invalid or has expired', + 'The response parameter (token) was not passed', + 'The response parameter (token) is invalid or has expired. Most of the time, this means a fake token has been used. If the error persists, contact customer support', 'The widget ID extracted from the parsed site secret key was invalid or did not exist', 'The secret extracted from the parsed site secret key was invalid', 'The request was rejected because it was malformed', - 'The response parameter has already been validated before', + 'The response parameter (token) has already been validated before. This means that the token was issued five minutes ago and is no longer valid, or it was already redeemed', 'An internal error happened while validating the response. The request can be retried', 'Challenge timeout', 'Expected hostname did not match', 'Expected action did not match', 'Expected cdata did not match', 'Invalid JSON received', - 'Not a success, but no error codes received!', + 'Not a success, but no error codes received', ], ErrorCode::toDescription( [