Must provide source or customer. laravel 8 stripe payment gateway

  banking, laravel, stripe-payments

Must provide source or customer. laravel 8 stripe payment gateway

StripeController

 public function stripe()
{
    return view('stripe');
}

public function stripePost(Request $request)
{
    StripeStripe::setApiKey(env('STRIPE_SECRET'));
    StripeCharge::create ([
            "amount" => 100*100,
            "currency" => "INR",
            "source" => $request->stripeToken,
            "description" => "This payment is testing purpose of websolutionstuff.com",
    ]);

    Session::flash('success', 'Payment Successful !');
       
    return back();
}

Source: Laravel

Leave a Reply