The detriment caused by the breach of a carrier's obligation to accept freight, messages, or passengers is deemed to be the difference between the amount which the carrier had a right to charge for the carriage and the amount it would be necessary to pay for the same service when it ought to be performed.