Class: VaultedBilling::Gateways::Bogus

Inherits:
Object
  • Object
show all
Includes:
VaultedBilling::Gateway
Defined in:
lib/vaulted_billing/gateways/bogus.rb

Overview

The Bogus gateway should only be used for simple interface testing to the VaultedBilling library. All customer and credit card requests will always return successfully. All transaction requests (purchase, authorize, capture, etc.) will always return successfully.

The primary purpose of this gateway is to provide you with an end point for testing your interface, as well as a fairly reasonable gateway for performing simple, non-network based tests against.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Bogus

Returns a new instance of Bogus.



18
19
# File 'lib/vaulted_billing/gateways/bogus.rb', line 18

def initialize(options = {})
end

Instance Method Details

#add_customer(customer) ⇒ Object



21
22
23
# File 'lib/vaulted_billing/gateways/bogus.rb', line 21

def add_customer(customer)
  respond_with(customer.to_vaulted_billing) { |c| c.vault_id = new_identifier }
end

#add_customer_credit_card(customer, credit_card, options = {}) ⇒ Object



33
34
35
# File 'lib/vaulted_billing/gateways/bogus.rb', line 33

def add_customer_credit_card(customer, credit_card, options = {})
  respond_with(credit_card.to_vaulted_billing) { |c| c.vault_id = new_identifier }
end

#authorize(customer, credit_card, amount, options = {}) ⇒ Object



45
46
47
# File 'lib/vaulted_billing/gateways/bogus.rb', line 45

def authorize(customer, credit_card, amount, options = {})
  transaction_response
end

#capture(transaction_id, amount, options = {}) ⇒ Object



57
58
59
# File 'lib/vaulted_billing/gateways/bogus.rb', line 57

def capture(transaction_id, amount, options = {})
  transaction_response
end

#purchase(customer, credit_card, amount, options = {}) ⇒ Object



49
50
51
# File 'lib/vaulted_billing/gateways/bogus.rb', line 49

def purchase(customer, credit_card, amount, options = {})
  transaction_response
end

#refund(transaction_id, amount, options = {}) ⇒ Object



61
62
63
# File 'lib/vaulted_billing/gateways/bogus.rb', line 61

def refund(transaction_id, amount, options = {})
  transaction_response
end

#remove_customer(customer) ⇒ Object



29
30
31
# File 'lib/vaulted_billing/gateways/bogus.rb', line 29

def remove_customer(customer)
  respond_with customer.to_vaulted_billing
end

#remove_customer_credit_card(customer, credit_card) ⇒ Object



41
42
43
# File 'lib/vaulted_billing/gateways/bogus.rb', line 41

def remove_customer_credit_card(customer, credit_card)
  respond_with credit_card.to_vaulted_billing
end

#update_customer(customer) ⇒ Object



25
26
27
# File 'lib/vaulted_billing/gateways/bogus.rb', line 25

def update_customer(customer)
  respond_with customer.to_vaulted_billing
end

#update_customer_credit_card(customer, credit_card, options = {}) ⇒ Object



37
38
39
# File 'lib/vaulted_billing/gateways/bogus.rb', line 37

def update_customer_credit_card(customer, credit_card, options = {})
  respond_with credit_card.to_vaulted_billing
end

#void(transaction_id, options = {}) ⇒ Object



53
54
55
# File 'lib/vaulted_billing/gateways/bogus.rb', line 53

def void(transaction_id, options = {})
  transaction_response
end