Paddle payments
Hello again,
Final push for my app. Billing is now the topic of the day.
I have three different options I want to present to my clients:
- Basic
- Standard
- Enterprise
Each package needs the option to specify the amount of servers and devices that they can use with the software.
How can I achieve this?
I can provide more information if required.
Hey Brian 👋,
Sounds great! Excited to test out your project once it's released.
I think that this could work similar to how you've implemented the max_alerts
here.
This time, you could add the column to your Plans table, it could be called something like allowed_servers
for example.
Then you could have a method that returns this, eg:
public function allowedServers(User $user)
{
// Get the maximum allowed servers for the user's plan
$allowedServers = $user->plan->allowed_servers;
// Count the number of servers the user has already created
$currentServersCount = $user->servers()->count();
return $currentServersCount < $allowedServers;
}
And then you could use that logic to check if the user is allowed to add more servers.
The method could either be included in the plan or in the role. That way you can do the validation based on the plan that the user uses.
Let me know if this would work!
Update:
I figured out the paddle issue.
They only problem I have left is that users need to be able to specify how many servers and devices on checkout. So when they click a subscription plan, they need to have an option to specify the amount of servers and amount of devices. This then will change the total and continue from there.
Ah I see! Thanks for that clarification Brian! Would this be a one time charge or will this be the recurring subscription price?
What you could do is actually enable quantities:
That way 1 package can be purchased multiple times. I will have to think how to implement this logic on the backend though :/