pub fn payment_amount(
words: &MoneyWords,
subject: &str,
text: &str,
) -> Option<Found>Expand description
The amount a payment message is about, in this order of trust:
- the only amount of the subject (“SHOP: 23,98 € EUR”);
- the amount after a sentence that states the payment (“Vous avez payé 387,00 €”);
- the amount on the total’s line, or on the line after its label (receipts set them in a table);
- the last amount above zero, the way receipts end with what was paid.
Lines of the legal footer are skipped, so a share capital is never read
as a payment. The words: MoneyWords (the sentences that state a
payment, the labels of the total’s line, the legal footer’s words).