I'm using a number of hooks to set a credit card surcharge to an event registration. I have it mostly working, however there are some cosmetic issues remaining.
Using hook_civicrm_preProcess, I have been able to set the line item surcharge, which on viewing the registration confirmation page is showing correctly.
Below the line item cost is an Event Total row. This is the problem I'm having - the Event Total is not reflecting the change to the line item cost.
I have tried amending the $form->_totalAmount value in hook_civicrm_buildForm but this doesn't reflect the change either. Either I'm trying to set the wrong value or the confirmation page has already been built before hook_civicrm_buildForm has been called.
Any advice would be most welcome!