fix some issu
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user