Module: Testopia::ActiveMerchant

Defined in:
lib/testopia/active_merchant.rb

Instance Method Summary collapse

Instance Method Details

#address(options = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/testopia/active_merchant.rb', line 21

def address(options = {})
  {
    :name => "John Doe",
    :address1 => "2500 Oak Mills Road",
    :address2 => "Suite 1000",
    :city => "Beverly Hills",
    :state => "CA",
    :country => "US",
    :zip => '90210'
  }.update(options)
end

#credit_card(options = {}) ⇒ Object



17
18
19
# File 'lib/testopia/active_merchant.rb', line 17

def credit_card(options = {})
  ::ActiveMerchant::Billing::CreditCard.new( credit_card_hash(options) )
end

#credit_card_hash(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/testopia/active_merchant.rb', line 5

def credit_card_hash(options = {})
  {
    :number => '1',
    :first_name => 'John',
    :last_name => 'Doe',
    :month => '8',
    :year  => "#{Time.now.year + 1}",
    :verification_value => '123',
    :type => 'visa'
  }.update(options)
end