modify this code into service and controller public function redirectToPaystack(Request $request)
    {
        $validate = validator($request->all(), [
            'amount' => 'required|numeric',
        ]);

        if($validate->fails())
        {
            $notify[] = ["error", "$validate->errors()"];

            return redirect()->back()->withNotify($notify);
        }

        $user = Auth::guard('artisan')->user();

        $charges = generate_paystack_charges($request->amount);
        $payload ['amount'] = $request->amount + $charges;
        $payload ['email'] = $user->email;
        $payload ['reference'] = $reference = Str::random(8);
        $payload ['coin'] = $request->coin;

        $payUrl = create_payment_url($payload, $request->input());

        $dump = $request->input();
        $dump['user_id'] = $user->id;

        DB::table('temp')->insert([
            'payload' => json_encode($dump),
            'reference' => $reference
        ]);

        $notify[] = ['You will now be redirected to paystack to make payment of ₦" . number_format($request->amount) . "+ ₦" . number_format($charges) . " in order to complete transaction'];

        return redirect($payUrl)->withNotify($notify);

    }