I'm trying to recalculate the final payment value of a contribute page that I'm using on a webform.
Depending on the value of certain fields recorded when submitting the form (the fields are custom fields attached to contacts), the membership fee needs to increase or decrease.
I've looked at the civicrm preprocess and postprocess hooks although it seems they're only called when the form is finally submitted. I need to chance the value before the form is submitted so the correct payment value is passed to the payment processor.