Skip to content

Commit fedc176

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 1c6f6c2 + 91fb978 commit fedc176

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Core/CurlRequestClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
namespace TimeHunter\LaravelGoogleReCaptchaV3\Core;
1010

11+
use Illuminate\Support\Facades\Lang;
1112
use TimeHunter\LaravelGoogleReCaptchaV3\Interfaces\RequestClientInterface;
1213

1314
class CurlRequestClient implements RequestClientInterface
@@ -25,7 +26,7 @@ public function post($url, $body, $options = [])
2526
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
2627

2728
if (false === $response) {
28-
return '{"success": false, "error-codes": ["Curl Error Code: '.GoogleReCaptchaV3Response::ERROR_TIMEOUT.'"]}';
29+
return '{"success": false, "error-codes": ["Curl Error Code: '.Lang::get(GoogleReCaptchaV3Response::ERROR_TIMEOUT).'"]}';
2930
}
3031

3132
if ($httpCode !== 200) {

src/Core/GuzzleRequestClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace TimeHunter\LaravelGoogleReCaptchaV3\Core;
1010

1111
use GuzzleHttp\Client;
12+
use Illuminate\Support\Facades\Lang;
1213
use GuzzleHttp\Exception\ClientException;
1314
use GuzzleHttp\Exception\ConnectException;
1415
use TimeHunter\LaravelGoogleReCaptchaV3\Interfaces\RequestClientInterface;
@@ -27,7 +28,7 @@ public function post($url, $body, $options = [])
2728
} catch (ClientException $e) {
2829
return '{"success": false, "error-codes": ["Guzzle Client Error Code: '.$e->getCode().'"]}';
2930
} catch (ConnectException $e) {
30-
return '{"success": false, "error-codes": ["Guzzle Client Error Code: '.GoogleReCaptchaV3Response::ERROR_TIMEOUT.'"]}';
31+
return '{"success": false, "error-codes": ["Guzzle Client Error Code: '.Lang::get(GoogleReCaptchaV3Response::ERROR_TIMEOUT).'"]}';
3132
}
3233
}
3334
}

0 commit comments

Comments
 (0)