One idea that I think will work here to get around this problem is to have a set of custom_prefs.js that are always set when running gaia ui test automation that contain the payment prefs.

I'll talk with Fernando though to see if there's a SpecialPowers solution available though.