Class Index [+]

Quicksearch

ActiveMerchant::Billing::BogusGateway

Bogus Gateway

Constants

AUTHORIZATION
SUCCESS_MESSAGE
FAILURE_MESSAGE
ERROR_MESSAGE
CREDIT_ERROR_MESSAGE
UNSTORE_ERROR_MESSAGE
CAPTURE_ERROR_MESSAGE
VOID_ERROR_MESSAGE
REFUND_ERROR_MESSAGE

Public Instance Methods

authorize(money, credit_card_or_reference, options = {}) click to toggle source
    # File lib/active_merchant/billing/gateways/bogus.rb, line 21
21:       def authorize(money, credit_card_or_reference, options = {})
22:         money = amount(money)
23:         case normalize(credit_card_or_reference)
24:         when '1'
25:           Response.new(true, SUCCESS_MESSAGE, {:authorized_amount => money}, :test => true, :authorization => AUTHORIZATION )
26:         when '2'
27:           Response.new(false, FAILURE_MESSAGE, {:authorized_amount => money, :error => FAILURE_MESSAGE }, :test => true)
28:         else
29:           raise Error, ERROR_MESSAGE
30:         end      
31:       end
capture(money, reference, options = {}) click to toggle source
    # File lib/active_merchant/billing/gateways/bogus.rb, line 86
86:       def capture(money, reference, options = {})
87:         money = amount(money)
88:         case reference
89:         when '1'
90:           raise Error, CAPTURE_ERROR_MESSAGE
91:         when '2'
92:           Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
93:         else
94:           Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
95:         end
96:       end
credit(money, credit_card_or_reference, options = {}) click to toggle source
    # File lib/active_merchant/billing/gateways/bogus.rb, line 57
57:       def credit(money, credit_card_or_reference, options = {})
58:         if credit_card_or_reference.is_a?(String)
59:           deprecated CREDIT_DEPRECATION_MESSAGE
60:           return refund(money, credit_card_or_reference, options)
61:         end
62: 
63:         money = amount(money)
64:         case normalize(credit_card_or_reference)
65:         when '1'
66:           Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true )
67:         when '2'
68:           Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
69:         else
70:           raise Error, CREDIT_ERROR_MESSAGE
71:         end
72:       end
purchase(money, credit_card_or_reference, options = {}) click to toggle source
    # File lib/active_merchant/billing/gateways/bogus.rb, line 33
33:       def purchase(money, credit_card_or_reference, options = {})
34:         money = amount(money)
35:         case normalize(credit_card_or_reference)
36:         when '1', AUTHORIZATION
37:           Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
38:         when '2'
39:           Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
40:         else
41:           raise Error, ERROR_MESSAGE
42:         end
43:       end
recurring(money, credit_card_or_reference, options = {}) click to toggle source
    # File lib/active_merchant/billing/gateways/bogus.rb, line 45
45:       def recurring(money, credit_card_or_reference, options = {})
46:         money = amount(money)
47:         case normalize(credit_card_or_reference)
48:         when '1'
49:           Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
50:         when '2'
51:           Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true)
52:         else
53:           raise Error, ERROR_MESSAGE
54:         end
55:       end
refund(money, reference, options = {}) click to toggle source
    # File lib/active_merchant/billing/gateways/bogus.rb, line 74
74:       def refund(money, reference, options = {})
75:         money = amount(money)
76:         case reference
77:         when '1'
78:           raise Error, REFUND_ERROR_MESSAGE
79:         when '2'
80:           Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true)
81:         else
82:           Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true)
83:         end
84:       end
store(credit_card_or_reference, options = {}) click to toggle source
     # File lib/active_merchant/billing/gateways/bogus.rb, line 109
109:       def store(credit_card_or_reference, options = {})
110:         case normalize(credit_card_or_reference)
111:         when '1'
112:           Response.new(true, SUCCESS_MESSAGE, {:billingid => '1'}, :test => true, :authorization => AUTHORIZATION)
113:         when '2'
114:           Response.new(false, FAILURE_MESSAGE, {:billingid => nil, :error => FAILURE_MESSAGE }, :test => true)
115:         else
116:           raise Error, ERROR_MESSAGE
117:         end              
118:       end
unstore(reference, options = {}) click to toggle source
     # File lib/active_merchant/billing/gateways/bogus.rb, line 120
120:       def unstore(reference, options = {})
121:         case reference
122:         when '1'
123:           Response.new(true, SUCCESS_MESSAGE, {}, :test => true)
124:         when '2'
125:           Response.new(false, FAILURE_MESSAGE, {:error => FAILURE_MESSAGE },:test => true)
126:         else
127:           raise Error, UNSTORE_ERROR_MESSAGE
128:         end
129:       end
void(reference, options = {}) click to toggle source
     # File lib/active_merchant/billing/gateways/bogus.rb, line 98
 98:       def void(reference, options = {})
 99:         case reference
100:         when '1'
101:           raise Error, VOID_ERROR_MESSAGE
102:         when '2'
103:           Response.new(false, FAILURE_MESSAGE, {:authorization => reference, :error => FAILURE_MESSAGE }, :test => true)
104:         else
105:           Response.new(true, SUCCESS_MESSAGE, {:authorization => reference}, :test => true)
106:         end
107:       end

Private Instance Methods

normalize(credit_card_or_reference) click to toggle source
     # File lib/active_merchant/billing/gateways/bogus.rb, line 133
133:       def normalize(credit_card_or_reference)
134:         if credit_card_or_reference.respond_to?(:number)
135:           credit_card_or_reference.number
136:         else
137:           credit_card_or_reference.to_s
138:         end
139:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.