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

isbkch's avatar

How does Spark support one time payements

I don't want to deal with subscriptions for my next project, but rather one time payements (purchases). How does Spark support that ?

I'm also wondering if there are plans to support a "wallet" system where users can load money into their wallet and use it for purchases later.

0 likes
8 replies
EventFellows's avatar

It's not documented on the spark docs but you can checkout the cashier documentation - there are two ways to handle one-time-payments (with and without invoicing for it)

In terms of wallet functionality, there is something that spark calls 'starting balance' in the invoices it creates - it reflects any positive balance a user might have on stripe. I have only seen a positive balance if a customer purchases a plan (let's say for 100$), then cancels his subscription and then 'resumes' a cheaper subscription (for e.g. 10$). Then the user would have 90$ balance (there is some pro-rating that also gets factored in here depending on time user was on the plan). There might be a way to directly set the balance. If so this comes pretty close to your wallet idea.

1 like
depsimon's avatar

About the wallet system I guess that you could create a balance column in the users table and add/remove virtual money when the user is being charged (with Cashier or Spark) or when the user purchases something.

1 like
isbkch's avatar

@EventFellows Thank you :) I've been checking Cashier documentation.

I noticed that if I remove the payed subscription plans from Spark Service Provider, The Billing section is then hidden from user profile.

Spark thinks that since we don't have no plans, no need to show it. But I need users to put their banking information, I still need to generate invoices for them for every purchase they make.

Are you aware of an an option to always show the billing section, or should I hack the code ?

isbkch's avatar

@depsimon Yes of course, I'm just thinking about functionality to load money into your wallet (Like the Envato does) with all features that come with it. It would be nice if this was already implemented.

EventFellows's avatar

I don't have any solution that I know that works. Spark seem to be hardcoded based on the assumption that customer does not need to put in an billing during sign up if there is not paid subscription.

In the backend though, the user can put in his payment method WITHOUT needing to sign up for a plan (under user navigation payment-method). May this can be used in some way... (but have not thought it through so far, but I'd be interested in your solutioni if you find one).

I belive the code you would need to 'hack' is in the views files that you should be able to change without loosing general update-ability.

1 like
EventFellows's avatar

@isbkch Have you solved the on-time-payment challenge. If yes, could you share your findings?

fwartner's avatar

$user->charge('amount_in_cents') if you´re using stripe.. :) (According to the Cashier-Docs)

jaythegeek's avatar

Sorry to revive this post, but I am also facing a similar issue, I need a mix of subscription as Spark does out of the box, but I also need one time payments for other services. I need them to be shown in the 'Billing Area' in Spark, I was told by @TaylorOtwell on Twitter to add it to the booted method.

I am really confused on how to do this, I see why, because it will be included in the Spark billing area but still cannot work this out! Any help or pointers would be much appreciated!

Please or to participate in this conversation.