Class: Dolla::PaymentStub

Inherits:
Object
  • Object
show all
Includes:
Gateway
Defined in:
lib/dolla/payment_stub.rb

Constant Summary

Constants included from Gateway

Gateway::ACTIONS

Constants included from Terms

Terms::BANK_FINANCED, Terms::NOT_FINANCED

Constants included from EndPoints

EndPoints::PRODUCTION_URL, EndPoints::TESTING_URL, EndPoints::WSDL_ADDRESS, EndPoints::XML_NAMESPACE

Constants included from Options

Options::OPTS

Instance Attribute Summary collapse

Attributes included from Gateway

#address, #amount, #card_expiration, #card_number, #cardholder, #code, #cvv, #email, #last_name, #name, #payment_id, #phone_number, #server_address, #user_agent, #zip_code

Instance Method Summary collapse

Methods included from Gateway

#amex?, #amex_avs_validation, #amex_typed_card, #build_amex_payment_body, #build_default_payment_body, #build_payment_body, #decimal_amount, #default_body_fields, #encrypted_customer_info, #full_name, #pay!, #payments_gateway, #reference, #soap_action, #wsdl_address, #xml_namespace

Methods included from EncryptionTools

#build_digest, #decimal_format, #padding, #rijndael_encrypt

Methods included from Terms

#payment_plan

Methods included from EndPoints

#get_wsdl_address, #get_xml_namespace

Methods included from Options

#get_option

Constructor Details

#initialize(opts = {}) ⇒ PaymentStub

Returns a new instance of PaymentStub.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/dolla/payment_stub.rb', line 7

def initialize opts = {}
  @attributes = {
    payment_id: 100,
    code: 'ABCDE',
    amount: "1.10",
    cvv: "123",
    card_number: "4111111111111111",
    card_expiration: 1.year.from_now,
    name: "Doroteo",
    last_name: 'Arango',
    address: '1911 Columbos',
    email: '[email protected]',
    phone_number: '6661231234',
    zip_code: "22000",
    user_agent: 'Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405',
    server_address: '127.0.0.1',
  }.merge!( opts )

  attributes.each do |prop, value|
    send("#{prop}=", value)
  end
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/dolla/payment_stub.rb', line 5

def attributes
  @attributes
end

Instance Method Details

#bank_account_termsObject



30
31
32
# File 'lib/dolla/payment_stub.rb', line 30

def 
  1
end

#card_typeObject



34
35
36
# File 'lib/dolla/payment_stub.rb', line 34

def card_type
  @card_type ||= Dolla::CardType.new(name: 'Visa', bank_code: 1)
end

#card_type_bank_codeObject



38
39
40
# File 'lib/dolla/payment_stub.rb', line 38

def card_type_bank_code
  card_type.bank_code
end