r/AskProgramming • u/knouqs • Apr 29 '26
Architecture How do we add a payment sources to our software?
Hello folks,
I am writing a system for which I expect at least three different types of users and a number of companies. For simplicity, let's call one of the groups "users", another "tech", and the third "billing". I also expect the "companies" in my model.
The "users" are the end users, not employed by the company. They pay $0. The "tech" group is the group that configures things for the end users; they pay $0 but work for one of the "companies". The "billing" group maintains contacts that each work for various companies.
I presume that licenses are purchased on behalf of each of the companies for the "tech" users to use.
I have never done this, but I have a DB model configured that does what I've described. How would I actually implement something like this such that companies can pay me for the software that I'm writing? What sorts of OTSS would I use to get paid? I am still in the design phase for this component, so if my understanding is misguided, please offer corrections.
Thanks for your help!
2
u/slowsquirrelchaser Apr 29 '26 edited Apr 29 '26
from what i understand, you have companies and you have people working for those companies. if you have many-to-many between companies and users, you should adjust the model below to account for that
* users can have either have different, exclusive roles admin/user/tech/billing, or i'd suggest you do base this on permissions, so that a user could have "tech", "billing", "admin", and other permissions (more flexible and future-proof)
* The company has a subscription for certain number of seats that allows them to invite users with the tech role, or assign tech role to any of the users. Whenever an admin would want to change a role to tech or add a new tech, you can check whether they have enough seats in the quota and either allow the action, or inform them and direct to payment system for adding additional seats to subscription
* The subscription can be edited by admin (the person who signed the company up), or anyone with the billing role/permission
i don't know what OTSS stands for, but if you are wondering how would you actually charge, stripe can simplify online checkouts and subscriptions, as well as customer management. you'd sync stripe with your system on the backend via hooks and explicit sync calls.
1
u/Vert354 Apr 29 '26
Conceptually you have 2 products. The one you're selling to your customers, and the one your customers need to use in order to pay you, a customer portal basicly. (They can be however tightly integrated as you like though)
In order to accept payment you will need to work with a bank to have a place for the funds to go, and whatever payment processors you want to accept (credit card, bank transfers, PayPal, Google/Apple pay, etc)
The payment providers likely will have an SDK or something to assist with integrating with your customer portal.
For license management there are several models. Primarily you see either named user licenses or concurrent licenses. How you track and enforce them is more of a business decision, you'll have to decide if it costs more to strictly enforce the licenses or to litigate after the fact if you discover they're using more than they paid for.
1
u/[deleted] May 04 '26
[removed] — view removed comment
1
u/[deleted] May 13 '26
[removed] — view removed comment