Class: Unit::Resource::AuthorizationRequestResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Unit::Resource::AuthorizationRequestResource
- Defined in:
- lib/unit/api_resources/authorization_request_resource.rb
Class Method Summary collapse
-
.approve(request) ⇒ UnitResponse, UnitError
Approve an authorization request by calling Unit’s API.
-
.decline(request) ⇒ UnitResponse, UnitError
Decline an authorization request by calling Unit’s API.
-
.get_authorization_request(request_id) ⇒ UnitResponse, UnitError
Get authorization request by calling Unit’s API.
-
.list(params = nil) ⇒ UnitResponse, UnitError
List authorization requests by calling Unit’s API.
Methods inherited from BaseResource
file_response_handler, response_handler
Class Method Details
.approve(request) ⇒ UnitResponse, UnitError
Approve an authorization request by calling Unit’s API
32 33 34 35 36 |
# File 'lib/unit/api_resources/authorization_request_resource.rb', line 32 def approve(request) payload = request.to_json_api response = HttpHelper.post("#{api_url}/authorization-requests/#{request.}/approve", body: payload, headers: headers) response_handler(response) end |
.decline(request) ⇒ UnitResponse, UnitError
Decline an authorization request by calling Unit’s API
41 42 43 44 45 |
# File 'lib/unit/api_resources/authorization_request_resource.rb', line 41 def decline(request) payload = request.to_json_api response = HttpHelper.post("#{api_url}/authorization-requests/#{request.}/decline", body: payload, headers: headers) response_handler(response) end |
.get_authorization_request(request_id) ⇒ UnitResponse, UnitError
Get authorization request by calling Unit’s API
16 17 18 19 |
# File 'lib/unit/api_resources/authorization_request_resource.rb', line 16 def (request_id) response = HttpHelper.get("#{api_url}/authorization-requests/#{request_id}", headers: headers) response_handler(response) end |
.list(params = nil) ⇒ UnitResponse, UnitError
List authorization requests by calling Unit’s API
24 25 26 27 |
# File 'lib/unit/api_resources/authorization_request_resource.rb', line 24 def list(params = nil) response = HttpHelper.get("#{api_url}/authorization-requests", params: params.to_hash, headers: headers) response_handler(response) end |