Module: AvaTax::Client::AgeVerification

Included in:
AvaTax::Client
Defined in:
lib/avatax/client/ageverification.rb

Instance Method Summary collapse

Instance Method Details

#find_age_verification(model) ⇒ Object

Fetches a previously stored age verification response.

The request must meet the following criteria in order to be evaluated:

  • firstName, lastName, and address are required fields.
  • One of the following sets of attributes are required for the address:

    • line1, city, region
    • line1, postalCode
  • Optionally, the request may use the following parameters:

  • A DOB (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).

  • Beyond the required address fields above, a country field is permitted

    • The valid values for this attribute are [US, USA] Swagger Name: AvaTaxBeverageClient

Parameters:

  • model (Object)

    Information about the individual whose age is being verified.

Returns:

  • (Object)


21
22
# File 'lib/avatax/client/ageverification.rb', line 21

def find_age_verification(model)        path = "/api/v2/ageverification/store/identity/find"
put(path, model, {}, AvaTax::VERSION)      end

#store_age_verification(model) ⇒ Object

Stores an age verification response for the account.

The request field must meet the following criteria in order to be evaluated:

  • firstName, lastName, and address are required fields.
  • One of the following sets of attributes are required for the address:

    • line1, city, region
    • line1, postalCode
  • Optionally, request field may use the following parameters:

  • A DOB (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).

  • Beyond the required address fields above, a country field is permitted

    • The valid values for this attribute are [US, USA]

The response field must meet the following criteria in order to be evaluated:

  • isOfAge, failureCodes are required fields Swagger Name: AvaTaxBeverageClient

Parameters:

  • model (Object)

    Information about the individual whose age has been verified and the corresponding age verification response.

Returns:

  • []



43
44
# File 'lib/avatax/client/ageverification.rb', line 43

def store_age_verification(model)        path = "/api/v2/ageverification/store/identity"
put(path, model, {}, AvaTax::VERSION)      end

#store_if_verified(model, options = {}) ⇒ Object

Conditionally performs an age verification check. If a record matching the request is found in the internal store, the associated response is returned. Otherwise, an age verification check is performed and the response is stored if the individual is determined to be of age.

The request must meet the following criteria in order to be evaluated:

  • firstName, lastName, and address are required fields.
  • One of the following sets of attributes are required for the address:

    • line1, city, region
    • line1, postalCode
  • Optionally, the request may use the following parameters:

  • A DOB (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).

  • Beyond the required address fields above, a country field is permitted

    • The valid values for this attribute are [US, USA] Swagger Name: AvaTaxBeverageClient

Parameters:

  • simulatedFailureCode (String)

    (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes.

  • model (Object)

    Information about the individual whose age is being verified.

Returns:

  • (Object)


62
63
# File 'lib/avatax/client/ageverification.rb', line 62

def store_if_verified(model, options={})        path = "/api/v2/ageverification/store/identity/storeIfVerified"
put(path, model, options, AvaTax::VERSION)      end

#verify_age(model, options = {}) ⇒ Object

Determines whether an individual meets or exceeds the minimum legal drinking age.

The request must meet the following criteria in order to be evaluated:

  • firstName, lastName, and address are required fields.
  • One of the following sets of attributes are required for the address:
    • line1, city, region
    • line1, postalCode

Optionally, the transaction and its lines may use the following parameters:

  • A DOB (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).
  • Beyond the required address fields above, a country field is permitted
    • The valid values for this attribute are [US, USA]

Security Policies This API depends on the active subscription AgeVerification Swagger Name: AvaTaxBeverageClient

Parameters:

  • simulatedFailureCode (String)

    (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes.

  • model (Object)

    Information about the individual whose age is being verified.

Returns:

  • (Object)


84
85
# File 'lib/avatax/client/ageverification.rb', line 84

def verify_age(model, options={})        path = "/api/v2/ageverification/verify"
post(path, model, options, AvaTax::VERSION)      end