The phone does not price the trip
What does this piece decide?
On Sevenco the route, the coupon, and the night window are already on the rider's phone. The fare is still written in the database, and the same function runs again when the trip ends.
A rider confirms a trip. The route, the coupon, and the night window are already on the phone. If the phone names the fare, the amount on the screen and the amount in the ledger can diverge.
The database prices the request
A one-way trip has to bring a distance from the route function, between 0 and 1,000 km. The database prices it from that rider's rates, the time window, and the night charge. A coupon row is locked and checked before the ride is inserted. The same write stores a 4-digit OTP. Booking keeps that figure as the estimate, including a B2B rate when the account has one.
The end of the trip can change the number
End photos send a one-way trip back through the same fare function. The trail can raise the amount. Night charge is taken from the actual start and end, and the coupon is applied to that new amount. The drop point is the phone's, or the last point saved on the trail. On a one-way trip, an actual drop past the threshold asks the rider to agree before the payment stands. The collect screen and the rider notification use that same figure. A round trip shows its clock from arrival. A one-way trip does not add a waiting charge.
Money writes when the trip is in collection
Confirming the ride does not charge the card. Cash, the rider wallet, and Razorpay settle when the trip is in collection. Paying from the wallet and confirming a Razorpay checkout go through server writes that recognise a repeat. A checkout that never finished can be abandoned and started again.
The rest of the rider's trip — the pin, the search, the masked call — is in the Sevenco case study.