We have already talked about the
architecture of external systems that form the hosting infrastructure of our
1cloud project, but this material does not reveal the important business issue of organizing the process of accepting payments and generating reports. Today we fill this gap.
Something went wrong
As often happens in the case of new projects, events in real life do not develop in the way that was originally intended. In the course of working on the 1cloud project, we faced a number of surprises, which affected, among other things, the organization of accounting tasks.
')
For example, we assumed that the bulk of customers would be individuals - and, accordingly, focused on meeting the needs of this particular segment of the audience in the first place. In fact, it turned out that our services are also in demand among legal entities - the number of customers-companies began to grow, which led to certain problems. We had to “handle” such clients manually (receiving payments, closing periods).
Over time, the volume of such manual work exceeded all reasonable thresholds and began to take a lot of time. We had no choice but to proceed with the automation of this task.
Automation of payments
At this point, we have redesigned the external site and the hosting admin panel (a
separate topic is devoted to this process). In its new version, the process of billing was facilitated - the user had to go to
the control panel , specify the details of the legal entity and press the button to generate an invoice for payment by bank transfer.
The bill looks like this:
After saving, it is available in the billing section (the invoice payment status is also displayed there):
After paying the bill, the money goes to the 1cloud account, and we see them only through the client bank, from where it gets into 1C. After that, automation starts - the scheduling starts the 1C handler, which looks at which incoming payments are not yet synchronized with the control panel (for each account replenishment operation, a register of information with a Boolean value is created) and a POST request is generated to the control panel API. The body of this request is passed an XML containing the details of the payments and the public key of the validation operation.
On the 1cloud side, this request is processed, according to similar rules, the public key of validation is generated (its system compares with the one transmitted in the request, in case of a mismatch, an error 500 returns - for simplicity we use HTTP codes). If the record of this operation (transaction) is not in the database, then a new operation is created that is tied to the invoice stored in the database. In the event that a transaction record already exists, the server returns an error code of 404.
Formation of acts for legal entities
Legal entities must provide reporting documents on services rendered - acts. For this first day of each month, 1C accesses the control panel API for billing data for the previous month. In response to this request, information is given on the infrastructure costs of each client who made a payment by bank transfer (or who has unclosed accounts - they were paid for, but not the entire amount paid was recorded in the acts). Lines of the act are divided by the balances from each account.
Then, on the basis of this data, the acts of completed work themselves are generated, they are sent to clients by email, and their details are sent back to the control panel as a separate POST request.
Of course, the public key is validated in the control panel - if it is correct, then acts will be generated for the paid invoices. If the account is completely “closed” by the acts, it is transferred to the Closed state.
What did it give us
This automation allowed the company to solve a number of tasks:
- Now we do not have to separately track the flow of money from customers through the bank client.
- The process of crediting money to the client’s current account in the hosting system has accelerated.
- There is no need to manually form acts - this relieved the technical specialists who had previously been forced to “unload” the billing data for accountants who sent the acts to clients manually.
- The client now always sees the status of payment of his bill, and can also easily get information about how much money is already taken into account in the acts of completed work.
- It became possible to obtain a duplicate of the act directly from the control panel.
Results
Despite the fact that in the course of the project to automate accounting tasks we didn’t make any technological revolution, this improvement allowed us to get rid of non-core work for the company (and free up inefficient resources for more important tasks, as well as improve the usability of the control panel for customers .
Now clients of legal entities can see full information about the state of the account and receive copies of accounting documents for their needs directly from the browser - initially all these problems were solved in manual mode, which was a result of an obvious mistake in planning, the consequences of which had to be corrected on the go.
That's all, thank you for your attention. Write in the comments about what elements of the infrastructure of the hosting provider would you like to know more?