How to pass a calculated amount to payment field?