Class: Erede::Services::CancelTransaction

Inherits:
Base
  • Object
show all
Defined in:
lib/erede/services/cancel_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

#send_request

Constructor Details

#initialize(store, transaction) ⇒ CancelTransaction



6
7
8
9
# File 'lib/erede/services/cancel_transaction.rb', line 6

def initialize(store, transaction)
  super(store)
  self.transaction = transaction
end

Instance Attribute Details

#transactionObject

Returns the value of attribute transaction.



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

def transaction
  @transaction
end

Instance Method Details

#executeObject



15
16
17
# File 'lib/erede/services/cancel_transaction.rb', line 15

def execute
  send_request(POST, transaction.to_json)
end

#urlObject



11
12
13
# File 'lib/erede/services/cancel_transaction.rb', line 11

def url
  "#{super}/#{transaction.tid}/refunds"
end