fix some issu

This commit is contained in:
2026-08-26 21:47:09 +03:30
parent 74cc50149f
commit 40b185187c
14 changed files with 179 additions and 72 deletions
@@ -26,12 +26,8 @@ class CentralSmsApiProvider implements SmsProviderInterface
->withHeaders([
'Content-Type' => 'application/json',
'secret_key' => 'f21debfb-83ac-4624-a2f4-f08375043181',
]);
$curlOptions = Controller::httpClientOptions();
if ($curlOptions !== []) {
$http = $http->withOptions($curlOptions);
}
])
->withOptions(Controller::httpClientOptions([], 15.0));
$host = trim((string) ($config['name_fa'] ?? ''));
if ($host === '') {
@@ -29,7 +29,7 @@ class MeliPayamakProvider implements SmsProviderInterface
];
$handle = curl_init('https://rest.payamak-panel.com/api/SendSMS/SendSMS');
curl_setopt_array($handle, [
$opts = [
CURLOPT_HTTPHEADER => ['content-type: application/x-www-form-urlencoded'],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYHOST => false,
@@ -37,7 +37,16 @@ class MeliPayamakProvider implements SmsProviderInterface
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($data),
CURLOPT_TIMEOUT => 30,
]);
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_PROXY => '',
];
if (defined('CURLOPT_IPRESOLVE') && defined('CURL_IPRESOLVE_V4')) {
$opts[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
}
if (defined('CURLOPT_HTTP_VERSION') && defined('CURL_HTTP_VERSION_1_1')) {
$opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
}
curl_setopt_array($handle, $opts);
$response = curl_exec($handle);
$error = curl_error($handle);
@@ -2,6 +2,7 @@
namespace App\Services\SmsBilling;
use App\Http\Controllers\Controller;
use Illuminate\Http\Client\Response;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
@@ -204,7 +205,8 @@ class SuperAdminSmsClient
try {
$pending = Http::withHeaders($this->authHeaders($method, $canonicalPath))
->acceptJson()
->timeout($timeout);
->timeout($timeout)
->withOptions(Controller::httpClientOptions([], (float) $timeout));
$url = $this->urlForBase($base, $relativeUrl);