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

fenos's avatar

[L5] One time payment Cashier

Hi guys, I want to implement one time (no subscriptions) payment with Stripe and Laravel Cashier. Reading the documentation I didn't find any methods that allow to do this.

How did you manage to implement this future?

Thanks guys for any suggest :)

0 likes
24 replies
bobbybouwmann's avatar

You can just assign a subscription to someone and set the data for that on forever right? I haven't used cashier yet, but I think there should be a possibility there!

fenos's avatar

@Ruffles Thanks i forgot about that series i just watched and it's really helpful, but it doesn't use Laravel Cashier but the original stripe API. I was hoping was possible to do it with Cashier.

@blackbird Mmmh it can be an "hack" way to do that, I prefer to don't assign the user to any subscription if they pay once. :)

fenos's avatar

@blackbird I don't want do a subscription plan, one time payment like when you buy a product in a e-commerce does it make sense to you? :) ( obviously i appreciated your time to try to help)

MikeHopley's avatar

One-time payments with Stripe are simple to set up, especially if you don't require webhook notifications. You don't need Cashier for this.

Just follow the Stripe tutorial.

Subscriptions are a good deal more hassle, which is why Cashier exists.

...having said all that, I see Cashier has some features that might be convenient. But it's really intended for subscriptions at the moment.

1 like
davorminchorov's avatar

According to the docs, Cashier is for subscriptions, not one-time payments.

2 likes
MikeHopley's avatar

No problem. :)

Cashier is pretty sweet if you (a) want subscriptions and (b) only need Stripe. At some point I want to check it out properly, just so I can learn from how Taylor did things.

tyloreddy's avatar

I noticed this: "If you would like to make a "one off" charge against a subscribed customer's credit card". What about creating a charge against a new customer that has not been assigned to any subscriptions? Anyone know if that is possible with cashier?

jekinney's avatar

Over on the stripe docs they mention you have to create a user object first. Then assign a subscription or a one time charge to be able to re-use c/c for charges. Not sure if cashier does that out of the box or not. You'll have to test it out. I've only used cashier personally for 100% subscription based, otherwise I use stripes php sdk and not cashier.

cliftonscott's avatar

Thanks, guys. I suppose the docs are slightly misleading as stated by @tyloreddy. The docs make is sound like you must use a subscribed customer's credit card for a one-off charge. But what if the customer is not subscribed? As @jekinney said, it seems as though creating a user object first is the way to go.

1 like
equipc's avatar

You have to create a card token first (using stripe.js), then create a client (using Cashier) and then you can do the one time charge/invoice.

if( ! $this->currentUser->stripe_id){
            $this->currentUser->createAsStripeCustomer($request->stripeToken);
}

$this->currentUser->invoiceFor($program->title, $program->price);
2 likes
Xurde-McFly's avatar

Thanks @equipc

It works :) Docs are a bit confusing and it's frustrating how people just answer pointing to the "Single Charge" section without taking into account the question here: Single Charge WITHOUT SUBSCRIPTIONS.

1 like
toddalbert's avatar

We have the ability to charge single charges. We have the ability to use coupons for subscriptions. Anyone know how to use coupons for single charges?

equipc's avatar

@toddalbert If you want to use coupons for single charges, you have to develop this yourself. Stripe doesn't allow coupons for single charge. So you have to send them the new price (with coupon applied) instead of the old one and a coupon code.

jekinney's avatar

Yup stripe is heavily based/opinionated for subscriptions. Meaning it obviously has a lot of features for subscriptions.

This is an older thread, but if you want to have stripe store a users c/c for future one click purchases you have to create a user object, assign them to a free subscription and charge them a one off subscription fee. Hacky yes. Confusing yes. But it's the only way I know off. Otherwise all one time charges a user is required to enter a c/c.

Maybe we just get the business logic in our head with subscriptions instead of using account.

connor11528's avatar

For one time charges I would not use Cashier.

Build the client side form with Stripe JS library: https://stripe.com/docs/elements

This allows us to get a token that we can send to our server (Laravel)

Once you send the token to server follow these steps in PHP for processing the charge: https://stripe.com/docs/charges

Cashier is meant to be for subscriptions, which are more complex

Robstar's avatar

The Laravel docs specifically states:

"If you're only performing "one-off" charges and do not offer subscriptions, you should not use Cashier. Instead, use the Stripe SDK directly"

This was initially a little confusing because there is section discussing single payments i.e. https://laravel.com/docs/5.8/braintree#single-charges

The key thing to note ion that section is the phrase:

"If you would like to make a "one off" charge against a subscribed customer's credit card ..."

To make a single charge you still require the customer be setup on subscription.

Larevel's recommend to not use Cashier for single /ADHOC charges therefore makes sense.

Please or to participate in this conversation.