Module: Unit::AuthorizationRequest
- Defined in:
- lib/unit/models/authorization_request/approve_request.rb,
lib/unit/models/authorization_request/decline_request.rb,
lib/unit/models/authorization_request/authorization_request.rb,
lib/unit/models/authorization_request/list_authorization_params.rb
Defined Under Namespace
Classes: ApproveRequest, DeclineRequest, ListAuthorizationParams
Constant Summary collapse
- AUTHORIZATION_REQUEST_LIMIT =
100
- AUTHORIZATION_REQUEST_OFFSET =
0
Class Method Summary collapse
-
.approve_authorization_request(authorization_request_id:, amount:, funding_account:, tags:) ⇒ Object
Approve authorization request.
-
.decline_authorization_request(authorization_request_id:, reason:) ⇒ Object
decline authorization request.
-
.get_authorization_request(authorization_request_id:) ⇒ Object
get authorization request.
-
.list_authorization_requests(limit = AUTHORIZATION_REQUEST_LIMIT, offset = AUTHORIZATION_REQUEST_OFFSET, account_id: nil, customer_id: nil, merchant_category_code: nil, from_amount: nil, to_amount: nil) ⇒ Object
list params for the authorization request.
Class Method Details
.approve_authorization_request(authorization_request_id:, amount:, funding_account:, tags:) ⇒ Object
Approve authorization request
25 26 27 28 |
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 25 def (authorization_request_id:, amount:, funding_account:, tags:) request = ApproveRequest.new(, amount, funding_account, ) Unit::Resource::AuthorizationRequestResource.approve(request) end |
.decline_authorization_request(authorization_request_id:, reason:) ⇒ Object
decline authorization request
34 35 36 37 |
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 34 def (authorization_request_id:, reason:) request = DeclineRequest.new(, reason) Unit::Resource::AuthorizationRequestResource.decline(request) end |
.get_authorization_request(authorization_request_id:) ⇒ Object
get authorization request
15 16 17 |
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 15 def (authorization_request_id:) Unit::Resource::AuthorizationRequestResource.() end |
.list_authorization_requests(limit = AUTHORIZATION_REQUEST_LIMIT, offset = AUTHORIZATION_REQUEST_OFFSET, account_id: nil, customer_id: nil, merchant_category_code: nil, from_amount: nil, to_amount: nil) ⇒ Object
list params for the authorization request
48 49 50 51 52 |
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 48 def (limit = AUTHORIZATION_REQUEST_LIMIT, offset = AUTHORIZATION_REQUEST_OFFSET, account_id: nil, customer_id: nil, merchant_category_code: nil, from_amount: nil, to_amount: nil) params = ListAuthorizationParams.new(limit, offset, account_id, customer_id, merchant_category_code, from_amount, to_amount) Unit::Resource::AuthorizationRequestResource.list(params) end |