Shopify/active_merchant — pull request #794 by cjoudrey (2013-08-09 02:31:34+00:00)
Title: ActiveMerchant::Billing::Base.gateway raises when passed an invalid gateway

Passing an invalid gateway to `ActiveMerchant::Billing::Base.gateway` raises `NameError`:

```ruby
irb(main):007:0> ActiveMerchant::Billing::Base.gateway('hotdog')
NameError: uninitialized constant ActiveMerchant::Billing::HotdogGateway
```

However, passing something that casts to an empty string will return `ActiveMerchant::Billing::Gateway`:

```ruby
irb(main):005:0> ActiveMerchant::Billing::Base.gateway(nil)
=> ActiveMerchant::Billing::Gateway
irb(main):006:0> ActiveMerchant::Billing::Base.gateway('')
=> ActiveMerchant::Billing::Gateway
```

**Note**: Should we look into raising a custom error instead of `NameError`? We could use `const_defined?` to determine. This is a breaking change though since some people probably rescue from `NameError`.

### Review

@jduff @melari