<?php
include("../init.php");
if (isset($_POST['verify'])) {
    extract($_POST);

    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://idverify.com.ng/api/verifyNIN",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 0,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => array('nin' => '32064990855'),
        CURLOPT_HTTPHEADER => array(
            "Content-Type: application/json",
            "Authorization: Bearer " . ID_VERIFY_TOKEN
        ),
    ));

    $response = curl_exec($curl);
    curl_close($curl);
    echo $response;
}
// 32064990855

// access token response
// {
//     "refresh_token_expires_in": "0",
//     "api_product_list": "[Payments V1, USSD]",
//     "api_product_list_json": [
//         "Payments V1",
//         "USSD"
//     ],
//     "organization_name": "mtn-prod",
//     "developer.email": "paisah12.ia@gmail.com",
//     "token_type": "BearerToken",
//     "issued_at": "1671019299940",
//     "client_id": "nwBIWgi1ULj0FTsFadJfD5EAgjIUzv3g",
//     "access_token": "BhGY3QREWq1coIXeXeDfhGxBe45X",
//     "application_name": "bbb4ac7d-1100-49da-a315-df4e330fcbc9",
//     "scope": "",
//     "expires_in": "3599",
//     "refresh_count": "0",
//     "status": "approved"
// }