Class: Dwolla::Transaction

Inherits:
Object
  • Object
show all
Includes:
Connection
Defined in:
lib/dwolla/transaction.rb

Constant Summary collapse

ENDPOINTS =
{ :send => 'transactions/send',
:request => 'transactions/request' }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Transaction

Returns a new instance of Transaction.



10
11
12
13
14
# File 'lib/dwolla/transaction.rb', line 10

def initialize(attrs = {})
  attrs.each do |key, value|
    send("#{key}=".to_sym, value)
  end
end

Instance Attribute Details

#amount ⇒ Object

Returns the value of attribute amount.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def amount
  @amount
end

#description ⇒ Object

Returns the value of attribute description.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def description
  @description
end

#destination ⇒ Object

Returns the value of attribute destination.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def destination
  @destination
end

#destination_type ⇒ Object

Returns the value of attribute destination_type.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def destination_type
  @destination_type
end

#id ⇒ Object

Returns the value of attribute id.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def id
  @id
end

#origin ⇒ Object

Returns the value of attribute origin.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def origin
  @origin
end

#pin ⇒ Object

Returns the value of attribute pin.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def pin
  @pin
end

#source ⇒ Object

Returns the value of attribute source.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def source
  @source
end

#source_type ⇒ Object

Returns the value of attribute source_type.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def source_type
  @source_type
end

#type ⇒ Object

Returns the value of attribute type.



8
9
10
# File 'lib/dwolla/transaction.rb', line 8

def type
  @type
end

Instance Method Details

#execute ⇒ Object



16
17
18
# File 'lib/dwolla/transaction.rb', line 16

def execute
  self.id = post(ENDPOINTS[type], to_payload)
end