diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index c847c13..b67de7d 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -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 diff --git a/app/Http/Controllers/Api/V1/OrderController.php b/app/Http/Controllers/Api/V1/OrderController.php index 12cb064..1599d22 100644 --- a/app/Http/Controllers/Api/V1/OrderController.php +++ b/app/Http/Controllers/Api/V1/OrderController.php @@ -47,14 +47,14 @@ class OrderController extends Controller $url = $response['url']; $order->update([ - 'halkbank_id' => $response['orderId'] + 'halkbank_id' => $response['orderId'], ]); } } return response()->rest([ 'order_id' => $order->id, - 'payment_url' => $url + 'payment_url' => $url, ], 201); } diff --git a/app/Http/Controllers/OnlinePaymentController.php b/app/Http/Controllers/OnlinePaymentController.php index 551eaa1..4d1c9c2 100644 --- a/app/Http/Controllers/OnlinePaymentController.php +++ b/app/Http/Controllers/OnlinePaymentController.php @@ -12,7 +12,7 @@ class OnlinePaymentController extends Controller public function index(Request $request) { $request->validate([ - 'orderId' => ['required', 'string'] + 'orderId' => ['required', 'string'], ]); $resource = Order::query()->where('halkbank_id', $request->orderId)->first(); @@ -46,7 +46,7 @@ class OnlinePaymentController extends Controller } public function view( - $status = false, + $status, $message, string $pnr = '-', string $branch_name = 'MM.COM.TM', diff --git a/app/Http/Controllers/TestController.php b/app/Http/Controllers/TestController.php index 266d628..1ba6617 100644 --- a/app/Http/Controllers/TestController.php +++ b/app/Http/Controllers/TestController.php @@ -33,8 +33,6 @@ class TestController extends Controller public function ok() { - - if (! app()->isProduction()) { auth()->login(User::where('email', 'nurmuhammet@mail.com')->first()); diff --git a/app/Listeners/Ecommerce/Order/SendOrderCreatedNotification.php b/app/Listeners/Ecommerce/Order/SendOrderCreatedNotification.php index 989ab52..b05cb7c 100644 --- a/app/Listeners/Ecommerce/Order/SendOrderCreatedNotification.php +++ b/app/Listeners/Ecommerce/Order/SendOrderCreatedNotification.php @@ -99,13 +99,13 @@ class SendOrderCreatedNotification implements ShouldQueue // Log::channel('order_sms_notification_sent_activity') // ->info(sprintf('SMS_SENT_FOR_ORDER[id, phone]: %s, %s', $order->id, orderAdminNumber())); - // User::where('phone_number', orderAdminNumber())->first()->notify( - // NovaNotification::make() - // ->message('Täze sargyt.') - // ->action('Gör', sprintf('/turkmenpostadmin/resources/orders/%s', $order->id)) - // ->icon('download') - // ->type('info') - // ); + // User::where('phone_number', orderAdminNumber())->first()->notify( + // NovaNotification::make() + // ->message('Täze sargyt.') + // ->action('Gör', sprintf('/turkmenpostadmin/resources/orders/%s', $order->id)) + // ->icon('download') + // ->type('info') + // ); // } }