Skip to content

Actual payoff amount can be different when calling makePayment() with different amounts #249

@wisdant

Description

@wisdant

Scenario:

  1. User borrows 1_000_000. With annual apr 12.17%. First bill is generated with 10_002 interest.
  2. User pays 900_000 immediately. Payment is applied to 10_002 interest first, then principal. After the payment, the user has a correction of -8902, and principal balance 110_002.
  3. The user makes another payment immediately to payoff the account. It turned out the system allows the user to pay off.
    makePayment parameter / actual amount collected for payoff
    101100 / 100089
    100700 / 10093
    100500 / 1005

This is because we try to calculate the correction amount for the final payment using the amount used in the makePayment call. We should have calculated the payoff correction using the entire principal due. In this way, we will achieve exactly the same payoff amount. For this particular case, the payoff amount should be 100_000. The user borrowed 1_000_000, since the user paid back immediately in two batches, there should be no interest generated, 100_000 makes perfect sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions