lib/active_merchant/billing/gateways/bogus.rb in smulube-activemerchant-1.5.1.2 vs lib/active_merchant/billing/gateways/bogus.rb in smulube-activemerchant-1.5.1.3
- old
+ new
@@ -17,49 +17,53 @@
self.supported_cardtypes = [:bogus]
self.homepage_url = 'http://example.com'
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
def void(ident, options = {})
case ident