-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: subscribe with the customer portal instead of stripe #6049
base: 4.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, great work 👍🏽
I left some comments ...
app/Console/Kernel.php
Outdated
@@ -54,6 +55,8 @@ protected function schedule(Schedule $schedule) | |||
$this->scheduleCommand($schedule, 'cloudflare:reload', 'daily'); | |||
} | |||
$this->scheduleCommand($schedule, 'model:prune', 'daily'); | |||
|
|||
$schedule->job(new CheckLicenceKeys)->everySixHours(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use the scheduleCommand
command, see above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if it's a not a command but a job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On some installation, schedule can't be done exactly at xx:00 hours. Laravel doesn't really support that.
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
Co-authored-by: Alexis Saettler <[email protected]>
…2022-03-07-billing
SonarCloud Quality Gate failed. |
We have two huge constraints ahead of us:
Because we'll have two versions of Monica, we should not manage two billing systems. I want the same subscription to work with Monica v1 and Monica v2.
The only solution for this is to move all billing logic to a dedicated app, that we call the customer portal. This customer portal will let customers purchase a licence key (with the same plans as we offer today), and we will use this licence key in both Monica v1 and Monica v2.
The best thing about moving all the billing logic from Monica to the customer portal is that we will finally be able
It's a win win.
So this is how it works:
valid_until_at
: the date the licence key should be renewedlicence_key
: the licence key itselffrequency
: monthly or annual planActivateLicenceKey
service does this:valid_until_at
field is reached. This job is calledCheckLicenceKeys
. It is triggered every six hours. This job checks if the key is still valid once the date is reached.For existing customers with Stripe:
is_on_stripe
on the Account table.stripe.blade.php
.CUSTOMER_PORTAL_STRIPE_URL
.Drawbacks:
CUSTOMER_PORTAL_URL
LICENCE_KEY_ENCRYPTION_KEY
CUSTOMER_PORTAL_SECRET_KEY