How to set the classes used in Drupal commerce buttons with Bootstrap theme
I'm having the same type of issue (which I will post elsewhere). I'm not sure I have the best answer, but from what I read in the Bootstrap API documentation, I believe your code should read as follows.

function [my-sub-theme]_colorize_text_alter(array &amp;$texts) {
  // Let's try a dummy change for a test
  $texts['contains'][t('Update cart')] = 'success';
}


The preceding "hook" needs to be entirely replaced by your [my-sub-theme] name.
From what I read, that should be what is needed for this to work. However, I'm having trouble getting it to work myself.