Skip to main content

payment_amount

Function payment_amount 

Source
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:

  1. the only amount of the subject (“SHOP: 23,98 € EUR”);
  2. the amount after a sentence that states the payment (“Vous avez payé 387,00 €”);
  3. the amount on the total’s line, or on the line after its label (receipts set them in a table);
  4. 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).