Payments

In the payments Movens procedure there are three logical blocks, which can be represented as follows:

Overview

Costing: Where the costs relating to the Trip just completed are calculated (taking into consideration rates, coupons and promotions), thus creating the receipt. Any additional costs (i.e. parking, fines and so on) will be added to this receipt if payment has not yet been made; otherwise, autonomous receipts will be created.

Debting: Where the Transaction is created and the balances of the account linked to the user are updated. This procedure is launched separately at the end of point (costing), so as not to weigh down the system. If you have opted for the prepaid method, and if the balance of the wallet is sufficient to pay the Trip, the checkout is not necessary, since it will be enough to scale it from the wallet balance.

Checkout: Which is separated from the first two parts by a time indicated in the system configuration (to give time that any additional charges can be recorded and then added to the amount to be collected) and which obviously changes depending on the payment method set, for example PayPal or via operator. In the case of the prepaid method, movements are recorded on the ‘Sales’ table. At the end of this procedure, if successful, the Transaction and Receipts are closed, and the balance on the wallet is updated. Checkout can also be done independently, if it is not related to travel.

Payments overview

Costing

When a trip ends, a Receipt and one or more ReceiptRows are created. Each ReceiptRows is a single operation, such as the cost of travel, any discounts, or additional costs such as parking or a fine. If these additional costs are received before payment of the receipt, they are recorded as lines of the receipt, otherwise a new receipt is created and processed. On a separate task, the Debting procedure is launched

Costing

Debting

It is checked if there are receipts to be processed; if so, a Transaction is created and the amount is deducted from the account. We therefore wait for the time set in the Configuration; at this point, there may be two situations:

  • We are in Prepaid regime, and therefore the Transaction is closed and is checked if the balance of the wallet is positive: in this case, the procedure ends, otherwise a recharging is requested

  • If, on the other hand, we are in final balance, a request for payment is launched

Debting

Checkout

In the Checkout procedure there are three entry points:

  • Stand alone recharging

  • The recharging derives from the negative account balance

  • A request for payment

In the first two cases, the procedure is identical with the only difference that in stand-alone recharge it is always asked how much to recharge, while in the recharge that derives from a negative balance the value can also derive from a calculation Once the amount is known, the system creates a Sales and a Transaction. At this point, you are asked to carry out the transaction; this is also the entry point in the third case, i.e. when there is a payment request. If the transaction is successful, the Transaction is closed, the Account updated and the procedure ends. If, on the other hand, the payment is not successful, it is checked if there is the possibility to do it again automatically; if so, the system waits for the number of seconds indicated in Configuration and tries again.

Checkout