Why the payment is not calculated properly in the form?