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

monsterdream's avatar

Cashier payment without user

Hi, It is possible to use Cashier without assigning payment to user instance ? I offer on my website adding advert without registration, so... you understand.

Only way I think is to download Stripe class and do it manually, but then it's a way around. Maybe there exist some simply trick to avoid that.

Another approach is to create fake User in db and assign this payment to him...

What do you think ?

0 likes
2 replies
monsterdream's avatar

Sorry, I had lucky and guess how to use Stripe straight without changing anything. If somebody would like to know how to do that, because I didn't find answer on forum:

Stripe::$apiKey = "";

    $charge = \Stripe\Charge::create(array(
            "amount" => 1000, // amount in cents, again
            "currency" => "sek",
            "source" => $request->stripeToken,
            "description" => "Example charge")
    );
londoh's avatar

Glad you got a solution, but my suggestion would be to create a user.

Maybe its 'splitting hairs', but its not a fake user as such. Its a user thats created specifically to handle those payments.

regards

l.

Please or to participate in this conversation.