Bogus Gateway
# File lib/active_merchant/billing/gateways/bogus.rb, line 86 def capture(money, reference, options = {}) money = amount(money) case reference when '1' raise Error, CAPTURE_ERROR_MESSAGE when '2' Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true) else Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true) end end
# File lib/active_merchant/billing/gateways/bogus.rb, line 57 def credit(money, credit_card_or_reference, options = {}) if credit_card_or_reference.is_a?(String) deprecated CREDIT_DEPRECATION_MESSAGE return refund(money, credit_card_or_reference, options) end money = amount(money) case normalize(credit_card_or_reference) when '1' Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true ) when '2' Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true) else raise Error, CREDIT_ERROR_MESSAGE end end
# File lib/active_merchant/billing/gateways/bogus.rb, line 33 def purchase(money, credit_card_or_reference, options = {}) money = amount(money) case normalize(credit_card_or_reference) when '1', AUTHORIZATION Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true) when '2' Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true) else raise Error, ERROR_MESSAGE end end
# File lib/active_merchant/billing/gateways/bogus.rb, line 45 def recurring(money, credit_card_or_reference, options = {}) money = amount(money) case normalize(credit_card_or_reference) when '1' Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true) when '2' Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE },:test => true) else raise Error, ERROR_MESSAGE end end
# File lib/active_merchant/billing/gateways/bogus.rb, line 74 def refund(money, reference, options = {}) money = amount(money) case reference when '1' raise Error, REFUND_ERROR_MESSAGE when '2' Response.new(false, FAILURE_MESSAGE, {:paid_amount => money, :error => FAILURE_MESSAGE }, :test => true) else Response.new(true, SUCCESS_MESSAGE, {:paid_amount => money}, :test => true) end end
# File lib/active_merchant/billing/gateways/bogus.rb, line 109 def store(credit_card_or_reference, options = {}) case normalize(credit_card_or_reference) when '1' Response.new(true, SUCCESS_MESSAGE, {:billingid => '1'}, :test => true, :authorization => AUTHORIZATION) when '2' Response.new(false, FAILURE_MESSAGE, {:billingid => nil, :error => FAILURE_MESSAGE }, :test => true) else raise Error, ERROR_MESSAGE end end
# File lib/active_merchant/billing/gateways/bogus.rb, line 120 def unstore(reference, options = {}) case reference when '1' Response.new(true, SUCCESS_MESSAGE, {}, :test => true) when '2' Response.new(false, FAILURE_MESSAGE, {:error => FAILURE_MESSAGE },:test => true) else raise Error, UNSTORE_ERROR_MESSAGE end end
# File lib/active_merchant/billing/gateways/bogus.rb, line 98 def void(reference, options = {}) case reference when '1' raise Error, VOID_ERROR_MESSAGE when '2' Response.new(false, FAILURE_MESSAGE, {:authorization => reference, :error => FAILURE_MESSAGE }, :test => true) else Response.new(true, SUCCESS_MESSAGE, {:authorization => reference}, :test => true) end end
Generated with the Darkfish Rdoc Generator 2.