How to send unique id to authorize.net?

I was wondering If you knew how to add an invoice code to the forms in Authorize.net.

my invoice number setting is RW-00000E, RW-00001E, RW-00002E…

I want to send this value to the invoice number field in authorize.net.
Plz help me.

Have you seen this solution?

Hi Nabi,

Can you give this snippet a try and see if it works for you.


add_filter( 'gform_authorizenet_transaction_pre_capture', 'gpui_set_unique_transaction_id', 10, 5 );
function gpui_set_unique_transaction_id( $transaction, $form_data, $config, $form ) {

    $target_form_id = 123; // update "123" to your form ID
    $unique_id_field_id = 4; // update "4" to your Unique ID field ID

    if( $form['id'] == $target_form_id && is_callable( 'gp_unique_id' ) ) {
        foreach ( $form['fields'] as $field ) {
            if ($field->id == $unique_id_field_id){
                $uid = gp_unique_id()->get_unique( $form['id'], $field );
                $transaction->invoice_num = $uid;
                $_POST[ "input_{$unique_id_field_id}" ] = $uid;
            }
        }
    }
    return $transaction;
}

Best,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.