How do I programmatically add a field to a Transaction in Drupal Commerce? I am attempting to add a field to the entity commerce_payment_transaction.  However, when I check the database after installation which should create the field, there is no field_data_ created, nor is there any field on the entity commerce_payment_transaction.  I have successfully used code similar to the following to create field on the Commerce Order.  Do I have the bundle wrong for the instance?

Here is my code.

During the install, I create the field and its instance.

function commerce_stripe_connect_c_install_install() {

$field_info = field_info_field('tr_vendor_user_reference');

$field = array(
        'field_name' =&gt; 'tr_vendor_user_reference',
        'type' =&gt; 'user_reference',
        'cardinality' =&gt; 1,
        'entity_types' =&gt; array('commerce_payment_transaction'),
        'translatable' =&gt; FALSE,
        'settings' =&gt; array(
                //must have the referenceable_status defined or the user reference won't work
                'referenceable_status' =&gt; array(
                        0 =&gt; 0,
                        1 =&gt; '1',
                ),
        ),


);

if (empty($field_info)) {
    field_create_field($field);
}

$instance = field_info_instance('commerce_payment_transaction', 'tr_vendor_user_reference', 'payment_method');

//I check if the vendor_user_reference has already been created on the commerce_product
if (empty($instance)) {
    $new_instance = array(
            'field_name' =&gt; 'tr_vendor_user_reference',
            'entity_type' =&gt; 'commerce_payment_transaction',
            'bundle' =&gt; 'payment_method',

            'label' =&gt; t('Transaction Vendor User Reference'),
            'required' =&gt; TRUE,
            'settings' =&gt; array(
                    //This is required so that vendors will be available for programmatically selecting
                    //for a product
                    'referenceable_status' =&gt; array(
                            0 =&gt; 0,
                            1 =&gt; '1',
                    ),

                    'view' =&gt; array(
                            'args' =&gt; array(),
                            'display_name' =&gt; '',
                            'view_name' =&gt; '',
                    ),

            ),
            //The widget will not show up because it is hidden later on, but this is needed so that
            //a default value can be chosen
            'widget' =&gt; array(
                    'active' =&gt; 1,
                    'module' =&gt; 'options',
                    'settings' =&gt; array(
                            'apply_chosen' =&gt; '',
                    ),
                    'type' =&gt; 'options_select',
                    'weight' =&gt; '40',
            ),


            'display' =&gt; array(),
    );
    field_create_instance($new_instance);
}
The payment transaction entity type isn't field-able (see commerce_payment_entity_info()).

But you can change that with hook_entity_info_alter():

function MYMODULE_entity_info_alter(&amp;$info) {
  $info['commerce_payment_transaction']['fieldable'] = TRUE;
}