Permalink
Browse files

adding support for stored credit cards to the bogus gateway

  • Loading branch information...
1 parent e1d0e29 commit 254e90fe74be6cf5f2465a1160ff3f0166edf384 Ben VandenBos committed with justinweiss May 11, 2009
Showing with 8 additions and 2 deletions.
  1. +1 −1 lib/active_merchant/billing/gateways/bogus.rb
  2. +7 −1 test/unit/gateways/bogus_test.rb
@@ -18,7 +18,7 @@ class BogusGateway < Gateway
self.display_name = 'Bogus'
def authorize(money, creditcard, options = {})
- case creditcard.number
+ case creditcard.respond_to?(:number) ? creditcard.number : creditcard
when '1'
Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money.to_s}, :test => true, :authorization => AUTHORIZATION )
when '2'
@@ -12,11 +12,17 @@ def setup
@response = ActiveMerchant::Billing::Response.new(true, "Transaction successful", :transid => BogusGateway::AUTHORIZATION)
end
- def test_with_string_card
+ def test_purchase_with_string_card
assert_nothing_raised do
assert(@gateway.purchase(1000, "1"))
end
end
+
+ def test_auth_with_string_card
+ assert_nothing_raised do
+ assert(@gateway.authorize(1000, "1"))
+ end
+ end
def test_authorize
@gateway.capture(1000, @creditcard)

0 comments on commit 254e90f

Please sign in to comment.