Permalink
Browse files

Added deprecation note for Money objects to Bogus gateway.

  • Loading branch information...
1 parent 1fd80d9 commit aa66e76d409093c359b109edf8e8b7eb0c0d52d4 @Soleone Soleone committed Apr 23, 2010
Showing with 12 additions and 8 deletions.
  1. +12 −8 lib/active_merchant/billing/gateways/bogus.rb
@@ -18,46 +18,50 @@ class BogusGateway < Gateway
self.display_name = 'Bogus'
def authorize(money, creditcard, options = {})
+ money = amount(money)
case creditcard.number
when '1'
- Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money.to_s}, :test => true, :authorization => AUTHORIZATION )
+ Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money}, :test => true, :authorization => AUTHORIZATION )
when '2'
- Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money.to_s, :error => FAILURE_MESSAGE }, :test => true)
+ Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money, :error => FAILURE_MESSAGE }, :test => true)
else
raise Error, ERROR_MESSAGE
end
end
def purchase(money, creditcard, options = {})
+ money = amount(money)
case creditcard.number
when '1'
- Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money.to_s}, :test => true)
+ Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
when '2'
- Response.new(false, FAILURE_MESSAGE, {:paid_amount => money.to_s, :error => FAILURE_MESSAGE },:test => true)
+ Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
else
raise Error, ERROR_MESSAGE
end
end
def credit(money, ident, options = {})
+ money = amount(money)
case ident
when '1'
raise Error, CREDIT_ERROR_MESSAGE
when '2'
- Response.new(false, FAILURE_MESSAGE, {:paid_amount => money.to_s, :error => FAILURE_MESSAGE }, :test => true)
+ Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
else
- Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money.to_s}, :test => true)
+ Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
end
end
def capture(money, ident, options = {})
+ money = amount(money)
case ident
when '1'
raise Error, CAPTURE_ERROR_MESSAGE
when '2'
- Response.new(false, FAILURE_MESSAGE, {:paid_amount => money.to_s, :error => FAILURE_MESSAGE }, :test => true)
+ Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
else
- Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money.to_s}, :test => true)
+ Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
end
end

0 comments on commit aa66e76

Please sign in to comment.