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

andy's avatar
Level 8

Stripe : single payment (not subscriptions)

Has anybody seen a package that will allow you to take advantage of Stripe's single payment option? Cashier seems to do only subscriptions ...

0 likes
11 replies
andy's avatar
Level 8

@MartelliEnrico Thanks!

Totally missed that in the documentation ...

hmmm ... "If you would like to make a "one off" charge against a subscribed customer's credit card, you may use the charge method:"

Maybe this not the solution I was looking for. I need to be able to just charge a customer like you would if using Paypal. I don't want to have it as a subscription.

1 like
StormShadow's avatar

@andy

They don't have to be subscribed user, just be a stripe customer.

 $customer = Auth::user()->subscription()->createStripeCustomer($request->stripe_token, [
            'email' => Auth::user()->email
        ]);

        Auth::user()->setStripeId($customer->id);
        Auth::user()->save();

        Auth::user()->charge(5000, ['currency' => 'cad', 'description' => 'A charge for something']);

I've tested this and it works. Hope that helps.

4 likes
TimeSocks's avatar

I think this misses OP's point though: Stripe can and does handle simple one off payments without the customer needing a subscription, and without requiring them to be logged in to any site. But there don't seem to be many tutorials on how to do this in Laravel 5.

3 likes
azimidev's avatar

According to the doc "If you're only performing "one-off" charges and do not offer subscriptions. You should not use Cashier. You should use the Stripe and Braintree SDKs directly."

"If you would like to make a "one off" charge AGAINST a SUBSCRIBED customer's credit card, you may use the charge method on a billable model instance."

1 like
AllSystemsDown's avatar

Modified @StormShadow's code, this is working for me:

$customer = $user->createAsStripeCustomer($stripeToken, [
    'email' => $user->email
]);

$update = $user->subscriptions()->create([
    'user_id' => $user->id,
    'name' => $plan->title,
    'stripe_id' => $customer->id,
    'stripe_plan' => $plan->id,
    'quantity' => 1,
    'created_at' => Carbon::now(),
    'updated_at' => Carbon::now()
]);

$user->charge($total_price, ['currency' => 'usd', 'description' => 'Charge for Extended (3 yr.) plan.']);
1 like
firouziam's avatar

I know its an old post. i'm posting just for future visitors:

I was able to charge the user without subscription using the following code.

$amount = some amount;
Stripe::setApiKey(Config::get('stripe.secret_key'));
$token = $input['stripeToken'];
$user = Auth::user();
return $user->charge($amount * 100, ['source' => $token]);

I wonder why they suggested to not use cashier. Is it gonna cause problems?

3 likes
cib88's avatar

I’ve just come across your answer and I’m thinking about taking this route. I already have subscriptions on my website but I’m wanting to add donations on there too which will be a one time payment.

Is it possible to do this without the user been registered? I need guests to be able to donate without signing up.

Please or to participate in this conversation.