# `accessor/creditfair.py` ## Overview This file acts as a client wrapper to interface with various internal CreditFair (CF) endpoints, Bureau endpoints, and the EMI Checkout Backend. It uses `hashids` to encode application IDs before transmitting them. ## Functions ### 1. CKYC Fetching - **`no_touch_callckyc(pan_number, dob, random_id, application_id)`**: - Hits `POST /api/ckyc/fetch`. - Parses the response to extract personal details (name, address, email, etc.) if `kycStatus` is `SUCCESS`. - Returns a structured dictionary containing the parsed data. - **`callckyc(pan_number, dob, random_id, mobile)`**: - Similar to `no_touch_callckyc`, but doesn't pass `application_id` in the request and injects the `mobile` number directly into the returned parsed dictionary. ### 2. Bureau Integration - **`fetch_bureau(...)`**: - Hits `POST /api/get-bureau-response`. - Sends comprehensive applicant details (PAN, name, address, loan amount, etc.) to fetch bureau credit data. - Returns the raw `requests` response object, or `True` on exception. ### 3. Verification & Decisions - **`electricity_bill(application_id, customer_id, provider, district, mobile_number)`**: - Hits `POST /api/electricity-bill-details`. - Used for utility bill validation. - **`epf_call_cf(company_name, consumer_name, mobile, email, application_id)`**: - Hits `POST /api/employment-verification`. - Used for Employee Provident Fund (EPF) verification based on employer and employee details. - **`run_auto_decision(application_id)`**: - Hits `GET /api/run-auto-decision`. - Hashes the `application_id` before querying the auto-decision engine. ### 4. Loan Offers - **`get_offers(application_id)`**: - Hits `GET /v1/loan_offer/applicable`. - Hashes the `application_id` and fetches the applicable loan offers for the customer. ### 5. Account Aggregator & Agreements - **`account_aggregator(application_id, redirect_url)`**: - Hits `POST /api/get-account-aggregator-link` to generate an AA link for the customer. - **`cf_sign_agreement(application_id, load_time, click_time)`**: - Hits `POST /api/sign-agreement` to record the loan agreement signing metrics. ## Dependencies - `requests`, `json`, `logging` - `config` - `hashids` (from `utils.hashing`) - `CustomExceptions` (from `exceptions.custom_exceptions`)