Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added deprecation note for Money objects to Bogus gateway.

  • Loading branch information...
commit aa66e76d409093c359b109edf8e8b7eb0c0d52d4 1 parent 1fd80d9
Dennis Theisen Soleone authored

Showing 1 changed file with 12 additions and 8 deletions. Show diff stats Hide diff stats

  1. +12 8 lib/active_merchant/billing/gateways/bogus.rb
20 lib/active_merchant/billing/gateways/bogus.rb
@@ -18,46 +18,50 @@ class BogusGateway < Gateway
18 18 self.display_name = 'Bogus'
19 19
20 20 def authorize(money, creditcard, options = {})
  21 + money = amount(money)
21 22 case creditcard.number
22 23 when '1'
23   - Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money.to_s}, :test => true, :authorization => AUTHORIZATION )
  24 + Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money}, :test => true, :authorization => AUTHORIZATION )
24 25 when '2'
25   - Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money.to_s, :error => FAILURE_MESSAGE }, :test => true)
  26 + Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money, :error => FAILURE_MESSAGE }, :test => true)
26 27 else
27 28 raise Error, ERROR_MESSAGE
28 29 end
29 30 end
30 31
31 32 def purchase(money, creditcard, options = {})
  33 + money = amount(money)
32 34 case creditcard.number
33 35 when '1'
34   - Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money.to_s}, :test => true)
  36 + Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
35 37 when '2'
36   - Response.new(false, FAILURE_MESSAGE, {:paid_amount => money.to_s, :error => FAILURE_MESSAGE },:test => true)
  38 + Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
37 39 else
38 40 raise Error, ERROR_MESSAGE
39 41 end
40 42 end
41 43
42 44 def credit(money, ident, options = {})
  45 + money = amount(money)
43 46 case ident
44 47 when '1'
45 48 raise Error, CREDIT_ERROR_MESSAGE
46 49 when '2'
47   - Response.new(false, FAILURE_MESSAGE, {:paid_amount => money.to_s, :error => FAILURE_MESSAGE }, :test => true)
  50 + Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
48 51 else
49   - Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money.to_s}, :test => true)
  52 + Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
50 53 end
51 54 end
52 55
53 56 def capture(money, ident, options = {})
  57 + money = amount(money)
54 58 case ident
55 59 when '1'
56 60 raise Error, CAPTURE_ERROR_MESSAGE
57 61 when '2'
58   - Response.new(false, FAILURE_MESSAGE, {:paid_amount => money.to_s, :error => FAILURE_MESSAGE }, :test => true)
  62 + Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
59 63 else
60   - Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money.to_s}, :test => true)
  64 + Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
61 65 end
62 66 end
63 67

0 comments on commit aa66e76

Please sign in to comment.
Something went wrong with that request. Please try again.