ajax()) { return DataTables::of($payments)->addColumn('action', function ($payment) { return ''.ctrans('texts.view').''; })->editColumn('payment_type_id', function ($payment) { return $payment->type->name; }) ->editColumn('status_id', function ($payment){ return Payment::badgeForStatus($payment->status_id); }) ->rawColumns(['action', 'status_id','payment_type_id']) ->make(true); } $data['html'] = $builder; return view('portal.default.payments.index', $data); } /** * Display the specified resource. * * @param \App\Models\Invoice $invoice The invoice * * @return \Illuminate\Http\Response */ public function show(RecurringInvoice $invoice) { } /** * Presents the payment screen for a given * gateway and payment method. * The request will also contain the amount * and invoice ids for reference. * * @param int $company_gateway_id The CompanyGateway ID * @param int $payment_method_id The PaymentMethod ID * @return void */ public function process($company_gateway_id, $payment_method_id) { $invoices = Invoice::whereIn('id', $this->transformKeys(request()->input('invoice_ids'))) ->whereClientId(auth()->user()->client->id) ->get(); $amount = request()->input('amount'); //build a cache record to maintain state $cache_hash = str_random(config('ninja.key_length')); Cache::put($cache_hash, 'value', now()->addMinutes(10)); //boot the payment gateway //build the gateway specific views $data = [ 'redirect_url' =>, 'invoices' => $invoices, 'amount' => $amount, 'gateway_data' =>, 'cache_hash' => $cache_hash, ]; return view('', $data); } }