How to pass calculation to a payment