validate([ 'orderId' => ['required', 'string'] ]); $response = Http::asForm()->post('https://mpi.gov.tm/payment/rest/getOrderStatusExtended.do', [ 'language' => 'ru', 'orderId' => $request->orderId, 'userName' => halkbankCredentials('username'), 'password' => halkbankCredentials('password'), ]); if ($response->failed()) { return $this->data([ 'success' => false, 'title' => 'Näsazlyk, operator bilen habarlaşyň', 'pnr' => '-', 'branch_name' => 'MM.COM.TM', 'price_amount' => '-', 'return_url' => 'https://mm.com.tm/orders', ]); } $payment_status = $response['paymentAmountInfo']['depositedAmount'] > 0; // Update resource $resource->update(['paid' => $payment_status]); return $this->view([ 'success' => $payment_status, 'title' => $payment_status ? 'Töleg geçdi' : 'Töleg geçmedi', 'pnr' => $response['orderNumber'], 'branch_name' => 'MM.COM.TM', 'price_amount' => number_format($response['amount']), 'return_url' => 'https://mm.com.tm/orders', ]); } public function view($data): View { return view('oninepayment.status', [ 'success' => $data['success'], 'title' => '', 'pnr' => '', 'branch_name' => '', 'price_amount' => '', 'return_url' => '', ]); } }