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

harvestmoonny's avatar

Customize Spark for one time payments

Hi all,

I've got a question, one that I cannot find on the internet myself unfortunately.

I know Spark is all subscription based. As it uses cashier under the hood, is it possible to customise spark (in an easy way) for one time payments as well? If so, what approach would be best?

(I love all the other features of Spark, thats why I'm asking)

Or would this be too much of a hassle and should I stick to just cashier for this?

Thank you!

0 likes
3 replies
rodrigo.pedra's avatar
Level 56

As it uses cashier under the hood...

Well, you already know it uses Cashier under the hood, what do you need different than making a simple charge using Cashier methods directly?

From the docs:

use Illuminate\Http\Request;
 
Route::post('/purchase', function (Request $request) {
    $stripeCharge = $request->user()->charge(
        100, $request->paymentMethodId
    );
 
    // ...
});

reference: https://laravel.com/docs/9.x/billing#simple-charge

Or would this be too much of a hassle and should I stick to just cashier for this?

I think it is not worth the hassle. Spark is build around subscriptions, and making changes around it, could led to your code being tightly coupled to Spark and make it difficult to upgrade to a new version in the future.

harvestmoonny's avatar

@rodrigo.pedra You make a very good point regarding it being tightly coupled to Spark. Thank you! It may be better to invest more time into developing my own payment system around cashier then 😀

1 like
rodrigo.pedra's avatar

@harvestmoonny you're welcome!

Sometimes we are tempted into adopting a technology we like everywhere, particularly true when we just learn about a new tech or technique.

But, from experience, (and not that I don't suffer from this anymore!), when we hit a corner case where the decision is not so clear, it is best to step back, breath, and assess the pros and cons on investing our time and energy on bending something to satisfy our use case.

It is tricky to resist to it, for example, when I learned best about event sourcing, I wanted to use it everywhere! And of course it is not a silver bullet for every case, and mainly would be an overkill on most cases.

But I get the feeling =) Glad I could help somehow. Have a nice day

1 like

Please or to participate in this conversation.