in the validation of my form i pass the form_state by reference and I modified the form state value of one of the fields with
$form_state['values']['field_total_payment']['und']['value'] = $total_payment;
I also tried
form_set_value($form['field_total_payment'], array('und' => array(0 => array('value' => $total_payment))), $form_state);
and I add a second submit to check if the value is there and I can see that with both pieces of code it is in the form_state['value'] , but it is not getting saved to the node.
What is missing for this information to be stored into the database?