There is a hook for that:
$transaction = apply_filters(‘gf_echeck_transaction_pre_capture’, $transaction, $submission_data, $form, $entry);
So an example might look like:
add_filter( ‘gf_echeck_transaction_pre_capture’, ‘set_invoice_number_for_echeck’, 10, 1 );
function set_invoice_number_for_echeck( $transaction ) {
// You might want to do some other sanitizing or even validate it before sending. This is just cleaned by with rgpost.
$value = rgpost( ‘input_2’ );
$transaction->setField( ‘invoice_num’, $value );
return $transaction;
}