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

onamfc's avatar

Stripe/Laravel single charge before registration

I am trying to run single charges using stripe and laravel, however the Laravel Cashier documentation that I can find requires the use of the $user object. The $user object is created after a user registers for the site, although I would rather the user pay, then upon successful payment, register.

Is it possible to create a charge using Cashier ~7.0 and Laravel 5.3 before registration?

0 likes
5 replies
jcorry's avatar

Have you considered allowing the registration (ie: creation of user) and then, based on the response from Stripe payment/Cashier, set the user's status to 'active' (or assign a role, or otherwise activate the created user)?

That would have the advantage of allowing you to create records of failed/incomplete registrations which you could use for marketing efforts to regain those users.

onamfc's avatar

@jcorry great idea! I recently completed a project that did exactly that, however I'm trying to prevent the need of creating roles and storing user credentials for users with declined payments along with payment specific pages.

I'm wondering if I can use an Event Listener to initiate the reg process after a payment is successful. I'm not sure if this is possible. Do you have any experience in doing this?

onamfc's avatar

@ahm750 thank you, that's my next option. My question to that would be how to allow only users with a successful payment register. For instance, maybe sending a one-use token back to my app that unlocks registration upon successful payment? Or maybe initiate a confirmation email sent to the user with a token in the link? Either way, I'm thinking I'll have to go forego Cashier and dive into the stripe API.

Thanks again!

ahm750's avatar

@onamfc I haven't tested Stripe, but from their documentation, it seems that they send back a reply to a script on your server.

What you can do is during the payment, you can also take their email and password. If the payment returns as success, create their account. Or the other method would be as you mentioned, send a confirmation email with a token.

Please or to participate in this conversation.