C
C
cat_crash2013-12-11 18:15:35
Payment systems
cat_crash, 2013-12-11 18:15:35

How to organize billing on the site?

Good day.
There is a site providing a service that was used locally. The site is written in yii.
Now we want to provide services with the help of this site on a paid basis (roughly speaking - unrolling ads, banners, etc.) and the question arises of how to "correctly" make billing.
Actually the process itself for what and how to shoot is understandable. The theory of billing is not clear, for example:
- How to store the amount of money on the account? Separate number or each time to recalculate income and expenses?
- How to store income, expenses of the client?
- How often to "update" the billing amount? There will be a huge number of small transactions, conditionally 1000 pieces per second for $0.0000000001.
I ask for pure theory. And a huge request not to poke into ready-made solutions like openX.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kiselyov, 2013-12-11
@cat_crash

I keep history and versions of everything.
I.e:

id | name | surname | email | 
&etc(различные другие поля) | 
plan_id(или planPrice) | 
budget(до последней оплаты) | totalBudget(за все время)

payment: payment history
id | client_id| date | 
&etc(различные другие поля) | 
revision(если в процессе стоимость или условия услуги поменялись) | 
price | 
pay (оплачено или нет, 0 или дата платежа)

also with them
sale: contribution history
id | client_id| date | 
&etc(различные другие поля) | 
summ (какая сумма)| 
refund (внесено или нет, 0 или дата платежа) |
type (метод оплаты, Paypal, наличность, банк &etc)

This is more difficult, but in high-load projects, you need to reset the database, otherwise you will overgrow
For example, collect transactions and once a day, per hour, 5 minutes (underline as necessary) dump into the archive or delete creating a record of received (unpaid funds)
transaction: transaction history
id | client_id| date | date_start | date_end |  archive_date_or_id | 
&etc(различные другие поля) | 
summ | count |
pay (выплачено или нет, 0 или дата платежа)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question