Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

greevesh's avatar

cartalyst/stripe-laravel: No such customer: person

I'm trying to process a credit card payment and I get this error: Must provide source or customer.

I'm not sure what Stripe means by this and I've tried the solution posted here: Stripe: Must provide source or customer

public function store(Request $request)
    {
        try {
            $charge = Stripe::charges()->create([
                // 'amount' => getNumbers()->get('newTotal') / 100,
                'currency' => 'UK',
                'source' => $request->stripeToken,
                'description' => 'Thank you for your purchase.',
                'receipt_email' => $request->email,
                'customer' => $request->email, 
                'metadata' => [
                    // 'contents' => $contents,
                    'quantity' => Cart::count(),
                ],
            ]);

            Cart::destroy();

            return redirect()->route('confirmation.index')->with('success_message', 'Thank you! Your payment has been successfully accepted!');
        } catch (CardErrorException $e) {
            return back()->withErrors('Error! ' . $e->getMessage());
        }
    }

As you can see, I do have a source and a customer. If I change the $customer property to equal something like 'person', Stripe will return this: No such customer: person

What exactly am I doing wrong here?

0 likes
3 replies
Wraith's avatar

This looks like callback, show screen from error and check what u have in request. This func is just simple create record in stripe table you cant get message from this like , no such customer person

greevesh's avatar

@wraith How do I create a record in the Stripe table? What do you mean by "show screen by error"?

Wraith's avatar

Thirst thing, what u have in

dd($request->stripeToken);

Please or to participate in this conversation.