Payment contract
Contract can have two type of payment:
- single_payment
- subscription
Single payment contract
When the user accept a single_payment contract the payment will go in the following way:
- A transaction from the buyer to the seller is created.
- The user can use the object.
If the contract is removed and accepted again, a new transaction will not created. At the contrary the old contract is reopened for the user.
Subscription contract
When the user accept a contract, the payment will go in the following way.
Begin of the period: A temporary transaction from the buyer to the administrator of Wappsto is created (stored money)
End of the period At the end of the period of the subscription, the stored money will be divided between the seller and the buyer in relation of how much the contract has been fulfilled
NB: The contract is renewed in relation of when the contract was published the first time. Not in relation of when an user accept the contract.
Fulfilling of a contract
The fulfilling of the contract is managed in relation of the rate_event assigned to the object. If no rate_event is assigned, the fulfilling of the contract is in relation of the time.
Subscription contract without rate_event
Consider the following values:
time_period: period of the subscription in seconds (end of the period - begin of the period)
used_period: period that the user used the subscription in seconds
price: cost of the subscription
The money will be divided in the following way:
money returned to seller = price * time_period / used_period
money returned to buyer = price - money returned to seller
Subscription contract with rate_event
Consider the following values:
periods_not_fulfilled: number of times the rate_event was not satisfied
time_period: period in seconds of the period of the subscription
rate_event: a value in seconds of how often a state should be updated
We have that:
all_periods = time_period / rate_event
The money will be divided in the following way:
money returned to buyer = price * periods_not_fulfilled / all_periods
money returned to seller = price - money returned to buyer