Method: Unit::ApiToken::Customer.create_customer_token

Defined in:
lib/unit/models/api_token/api_token.rb

.create_customer_token(customer_id:, scope:, verification_token:, verification_code: nil, expires_in: nil, resources: nil) ⇒ UnitResponse, UnitError

Create customer token by calling Unit’s API

Parameters:

  • customer_id (String)
  • scope (Array<String>)
  • verification_token (String)
  • verification_code (String) (defaults to: nil)
    • optional

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

  • resources (Array<RestrictedResource>) (defaults to: nil)
    • optional

Returns:

See Also:



57
58
59
60
61
# File 'lib/unit/models/api_token/api_token.rb', line 57

def create_customer_token(customer_id:, scope:, verification_token:, verification_code: nil, expires_in: nil,
                          resources: nil)
  request = CreateCustomerTokenRequest.new(customer_id, scope, verification_token, verification_code, expires_in, resources)
  Unit::Resource::ApiTokenResource.create_customer_token(request)
end