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

Class Method Details

.approve_authorization_request(authorization_request_id:, amount:, funding_account:, tags:) ⇒ Object

Approve authorization request

Parameters:

  • authorization_request_id (String)
  • amount (Integer)
    • optional

  • funding_account (String)
    • optional

  • tags (Hash)
    • optional

See Also:



25
26
27
28
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 25

def approve_authorization_request(authorization_request_id:, amount:, funding_account:, tags:)
  request = ApproveRequest.new(authorization_request_id, amount, , tags)
  Unit::Resource::AuthorizationRequestResource.approve(request)
end

.decline_authorization_request(authorization_request_id:, reason:) ⇒ Object

decline authorization request

Parameters:

  • authorization_request_id (String)
  • reason (String)

See Also:



34
35
36
37
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 34

def decline_authorization_request(authorization_request_id:, reason:)
  request = DeclineRequest.new(authorization_request_id, reason)
  Unit::Resource::AuthorizationRequestResource.decline(request)
end

.get_authorization_request(authorization_request_id:) ⇒ Object

get authorization request

Parameters:

  • authorization_request_id (String)

See Also:



15
16
17
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 15

def get_authorization_request(authorization_request_id:)
  Unit::Resource::AuthorizationRequestResource.get_authorization_request(authorization_request_id)
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

Parameters:

  • limit (Integer) (defaults to: AUTHORIZATION_REQUEST_LIMIT)
    • optional

  • offset (Integer) (defaults to: AUTHORIZATION_REQUEST_OFFSET)
    • optional

  • account_id (String) (defaults to: nil)
    • optional

  • customer_id (String) (defaults to: nil)
    • optional

  • merchant_category_code (Array) (defaults to: nil)
    • optional

  • from_amount (Integer) (defaults to: nil)
    • optional

  • to_amount (Integer) (defaults to: nil)
    • optional

See Also:



48
49
50
51
52
# File 'lib/unit/models/authorization_request/authorization_request.rb', line 48

def 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)
  params = ListAuthorizationParams.new(limit, offset, , customer_id, merchant_category_code, from_amount, to_amount)
  Unit::Resource::AuthorizationRequestResource.list(params)
end