How to pass a calculated amount to the payment field?