Fix sustainer test to avoid saving type error

The forcing of changing the $new_month value to string actually caused it
to fail validation which prevented it from being written at all -- avoiding
the problem instead of fixing it.

This actually discovers the source of the problem which is that the gateway
value was being passed in as the entire gateway object rather than just the
id.  This change will check to see which kind of the gateway data it
receives and compensates appropriately.