Class: Erede::Services::GetTransaction

Inherits:
Base
  • Object
show all
Defined in:
lib/erede/services/get_transaction.rb

Constant Summary

Constants inherited from Base

Base::GET, Base::POST, Base::PUT

Instance Attribute Summary collapse

Attributes inherited from Base

#store

Instance Method Summary collapse

Methods inherited from Base

#initialize, #send_request

Constructor Details

This class inherits a constructor from Erede::Services::Base

Instance Attribute Details

#referenceObject

Returns the value of attribute reference.



4
5
6
# File 'lib/erede/services/get_transaction.rb', line 4

def reference
  @reference
end

#refundIdObject

Returns the value of attribute refundId.



4
5
6
# File 'lib/erede/services/get_transaction.rb', line 4

def refundId
  @refundId
end

#refundsObject

Returns the value of attribute refunds.



4
5
6
# File 'lib/erede/services/get_transaction.rb', line 4

def refunds
  @refunds
end

#tidObject

Returns the value of attribute tid.



4
5
6
# File 'lib/erede/services/get_transaction.rb', line 4

def tid
  @tid
end

Instance Method Details

#executeObject



16
17
18
# File 'lib/erede/services/get_transaction.rb', line 16

def execute
  send_request(GET)
end

#urlObject



9
10
11
12
13
14
# File 'lib/erede/services/get_transaction.rb', line 9

def url
  raise(Erede::Errors::EredeError, 'You need to specify one: the tid or the reference') if !tid && !reference
  return "#{super}?reference=#{reference}" if reference
  return "#{super}/#{tid}/refunds#{refundId ? '/' + refundId.to_s : ''}" if refunds
  "#{super}/#{tid}"
end