How do I programmatically add a field to a Transaction in Drupal Commerce?
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;
}