This commit is contained in:
2025-09-25 15:28:35 +05:00
parent f5de6b0a58
commit b6bfcfcdd8
5 changed files with 26 additions and 29 deletions

View File

@@ -3,7 +3,6 @@
use App\Models\Auth\Verification;
use App\Models\Ecommerce\Channel\Channel;
use App\Models\Ecommerce\Product\Inventory\Inventory;
use App\Models\System\Settings\Settings;
use App\Repositories\Ecommerce\Product\Barcode\BarcodeRepository;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Support\Collection;
@@ -71,21 +70,21 @@ if (! function_exists('sendSMS')) {
function sendSMS(string|int $phone, string|int $message): mixed
{
$response = Http::retry(
times: 3,
sleepMilliseconds: 50,
throw: false,
when: function (Exception $exception, PendingRequest $request) {
Log::channel('sms_api_error')
->error('Exception: ', [
'message' => $exception->getMessage(),
'line' => $exception->getLine(),
]);
times: 3,
sleepMilliseconds: 50,
throw: false,
when: function (Exception $exception, PendingRequest $request) {
Log::channel('sms_api_error')
->error('Exception: ', [
'message' => $exception->getMessage(),
'line' => $exception->getLine(),
]);
return true;
})
return true;
})
->post('http://216.250.14.144:3000/api/data', [
'phone' => '+993'.$phone,
'code' => $message,
'phone' => '+993'.$phone,
'code' => $message,
]);
return $response->body();
@@ -355,7 +354,7 @@ if (! function_exists('calculateProductPriceAmount')) {
*/
function halkbankCredentials(string $key = ''): int|string|array
{
return match($key) {
return match ($key) {
'username' => 516122500260,
'password' => 'MrZsO9wfgWOBjf4',
default => [
@@ -368,7 +367,7 @@ function halkbankCredentials(string $key = ''): int|string|array
/**
* Create halkbank order
*
* @param string $price
* @param string $price
* @return array{status: string, url: string|null}
*/
function createHalkbankOrder($price = 123): array