FISIBSOpenAPI

Core

class q2_cores.FISIBSOpenAPI.core.Core(logger, core_user, hq_credentials=None, **kwargs)[source]

Bases: BaseCore

All cores will inherit from this common base class. This contains a self.configured_user property, which is an instance of q2_sdk.models.cores.models.core_user.CoreUser.

CONFIG_FILE_NAME = 'FISIBSOpenAPI_Core'
OPTIONAL_CONFIGURATIONS = {'ALLOW_JOINT_ENROLLMENT': False, 'DIGITAL_SIGNATURE': '00000000000000000000000200000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000018618618000000000000000000000000000000040000000000000000000000000000000000000000001000000000000000000000000000000600000040800000000000609014002400000D806EC0181', 'GET_DEMO_DATA_BY_ACCT': False, 'GET_DEMO_DATA_BY_CIF': False, 'INCLUDE_PASSPORT_IN_DEMO_INFO': False, 'INCLUDE_PHONE_AND_EMAIL': True, 'PASSPORT_ID_TYPE': '', 'USE_DYNAMIC_PROFILE': False}
async get_full_demographic_info()[source]

An attempt will be made to first build and send the request to retrieve demographic information by SSN, CIF, or Account. If the demographic call doesn’t include a passport number, and it’s required based on the configuration, another request is made to the core to grab passport information.

If phone or email information is missing from initial request, additional calls are made to the core to retrieve these values

Return type:

DemographicInfo

async build_demographic_info(search_method=None, signature=None)[source]

Builds a request to retrieve a user’s demographic information from the core using a search method (CIF, SSN, Account, DynamicProfile) and signature if provided. If a search method isn’t provided as a parameter, this function will search by SSN by default.

Note: INCLUDE_PHONE_AND_EMAIL configuration is only applicable to searches by CIF.

Return type:

DemographicInfoMapper

async get_phone_numbers(customer_number)[source]

Grabs phone numbers linked to the CIF

Return type:

List[Phone]

async get_email_addresses(customer_number)[source]

Grabs email addresses linked to the CIF

Return type:

List[str]

async fix_international_phones(phones)[source]

Fix area codes and local numbers for international phones

Phone numbers that are returned from the core in the “NonAmericanPhoneNo” field are provided as a string such as “+12 3 456 7890”. We don’t know which part of the number is the area code if that country uses area codes, so we need to check the Q2_Country table to find the expected patterns and reformat the Phone object data to conform to those patterns.

Parameters:

phones (List[Phone]) – Phone objects built from core data

Return type:

Phone

Returns:

Phone objects with fixed area codes and local numbers