@justinplouffe see https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/balanced.rb#L170-L173 for an approach that I think works for gateways that return meaningful status codes. Basically it considers all 4xx codes to be expected errors, and everything else to be an error.