modified value in form_state but it is not being saved 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'][0]['value'] = $total_payment;

I also tried  form_set_value($form['field_total_payment'], array('und' =&gt; array(0 =&gt; array('value' =&gt; $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?
Use

$form_state-&gt;setValue($key, $value);


In your case, that should be

$form_state-&gt;setValue(['field_total_payment'], $total_payment);