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

geerizzle's avatar

Adding regular Stripe shopping cart to Spark

As well as subscriptions I want to have a typical add-to-cart & checkout process for one-time purchases. This looks fairly straightforward to implement, but I was curious if there were any caveats doing this alongside the Spark subscription implementation.

Presumably they use the same stripe.js? When a user buys something & gets registered we'll have to avoid the standard register/subscribe form somehow. Anything else to be aware of?

0 likes
1 reply
azimidev's avatar

Not really there are no caveats using stripe and single charge. For instance i wanted to use Stripe to create a gym website. My client said I am going to have a single time joining fee. So the way I did was, in EventServiceProvider.php there are bunch of events when a user has subscribed so I created a listener called ChargeJoinFee and used it like so:

UserSubscribed::class => [
    UpdateActiveSubscription::class,
    UpdateTrialEndingDate::class,
    SendEmails::class,
    ChargeJoinFee::class,
],

and then in that listener I charged the user like so:

public function handle($event)
{
    $event->user->charge(2500);
}

Please or to participate in this conversation.