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

#amountObject

Returns the value of attribute amount.



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

def amount
  @amount
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#destinationObject

Returns the value of attribute destination.



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

def destination
  @destination
end

#destination_typeObject

Returns the value of attribute destination_type.



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

def destination_type
  @destination_type
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#originObject

Returns the value of attribute origin.



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

def origin
  @origin
end

#pinObject

Returns the value of attribute pin.



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

def pin
  @pin
end

#sourceObject

Returns the value of attribute source.



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

def source
  @source
end

#source_typeObject

Returns the value of attribute source_type.



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

def source_type
  @source_type
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#executeObject



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

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