Class: Unit::Resource::FeeResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Unit::Resource::FeeResource
- Defined in:
- lib/unit/api_resources/fee_resource.rb
Class Method Summary collapse
-
.create_fee(request) ⇒ UnitResponse, UnitError
Create a new fee by calling Unit’s API.
-
.reverse_fee(request) ⇒ UnitResponse, UnitError
Reverse a fee by calling Unit’s API.
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
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
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 |