Module: Unit::Authorization

Defined in:
lib/unit/models/authorization/get_request.rb,
lib/unit/models/authorization/list_request.rb,
lib/unit/models/authorization/authorization.rb

Defined Under Namespace

Classes: GetRequest, ListRequest

Constant Summary collapse

AUTHORIZATION_LIMIT =
100
AUTHORIZATION_OFFSET =
0

Class Method Summary collapse

Class Method Details

.get_authorization(authorization_id:, include_non_authorized: nil) ⇒ Object

Get authorization by id

Parameters:

  • authorization_id (String)
  • include_non_authorized (Boolean) (defaults to: nil)
    • optional

See Also:



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

def get_authorization(authorization_id:, include_non_authorized: nil)
  request = GetRequest.new(authorization_id, include_non_authorized)
  Unit::Resource::AuthorizationResource.get(request)
end

.list_authorizations(limit: AUTHORIZATION_LIMIT, offset: AUTHORIZATION_OFFSET, account_id: nil, customer_id: nil, card_id: nil, since: nil, until_: nil, include_non_authorized: nil, status: nil, merchant_category_code: nil, from_amount: nil, to_amount: nil, sort: nil) ⇒ Object

List authorizations

Parameters:

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

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

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

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

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

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

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

  • include_non_authorized (Boolean) (defaults to: nil)
    • optional

  • status (Array<String>) (defaults to: nil)
    • optional

  • merchant_category_code (Array<String>) (defaults to: nil)
    • optional

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

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

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

See Also:



35
36
37
38
39
# File 'lib/unit/models/authorization/authorization.rb', line 35

def list_authorizations(limit: AUTHORIZATION_LIMIT, offset: AUTHORIZATION_OFFSET, account_id: nil, customer_id: nil, card_id: nil, since: nil,
                        until_: nil, include_non_authorized: nil, status: nil, merchant_category_code: nil, from_amount: nil, to_amount: nil, sort: nil)
  request = ListRequest.new(limit, offset, , customer_id, card_id, since, until_, include_non_authorized, status, merchant_category_code, from_amount, to_amount, sort)
  Unit::Resource::AuthorizationResource.list(request)
end