first(); /** @var \App\Models\Payment\OnlinePaymentHistory $onlinePaymentResource */ $onlinePaymentResource = OnlinePaymentHistory::find($item->online_payment_history_id); if (! $onlinePaymentResource) { return ActionResponse::danger('Online payment resource tapylmady'); } $relatedResource = (new $onlinePaymentResource->online_paymantable_type) ->find(id: $onlinePaymentResource->online_paymantable_id); if (! $relatedResource) { return ActionResponse::danger('Bu resource tapylmady'); } $username = $relatedResource->branch->billing_sber_username; $password = $relatedResource->branch->billing_sber_password; if ($username == '') { return Action::modal('modal-response', [ 'title' => 'HALKBANK API', 'body' => 'Ulanyjy ady bilen açar sözi gabat gelmedi', ]); } $response = checkOnlinePayment($onlinePaymentResource->orderId, $username, $password); // syncWithBankSystem(); return Action::modal('modal-response', [ 'title' => 'HALKBANK API', 'html' => CheckOnlinePayment::resultHTML($response), ]); } /** * Get the fields available on the action. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function fields(NovaRequest $request) { return []; } }