Class: Unit::Resource::FeeResource

Inherits:
BaseResource show all
Defined in:
lib/unit/api_resources/fee_resource.rb

Class Method Summary collapse

Methods inherited from BaseResource

file_response_handler, response_handler

Class Method Details

.create_fee(request) ⇒ UnitResponse, UnitError

Create a new fee by calling Unit’s API

Parameters:

  • request (CreateFeeRequest)

Returns:



15
16
17
18
19
# File 'lib/unit/api_resources/fee_resource.rb', line 15

def create_fee(request)
  payload = request.to_json_api
  response = HttpHelper.post("#{api_url}/fees", body: payload, headers: headers)
  response_handler(response)
end

.reverse_fee(request) ⇒ UnitResponse, UnitError

Reverse a fee by calling Unit’s API

Parameters:

  • request (ReverseFeeRequest)

Returns:



24
25
26
27
28
# File 'lib/unit/api_resources/fee_resource.rb', line 24

def reverse_fee(request)
  payload = request.to_json_api
  response = HttpHelper.post("#{api_url}/fees/reverse", body: payload, headers: headers)
  response_handler(response)
end