idmaintzain/myidentitypass

此库将使您能够验证您的BVN/NIN/CAC/TIN/电话号码

v1.0 2022-01-18 13:34 UTC

This package is auto-updated.

Last update: 2024-09-19 20:58:54 UTC


README

安装

composer require idmaintzain/myidentitypass

此库将使您能够通过MyIdentityPass API(尼日利亚)验证您的BVN/NIN/CAC/TIN/电话号码。您可以在https://developer.myidentitypass.com/data-verification-1/nigeria查看MyIdentityPass官方网站以获取更多关于API的文档。

设置您的常量如下

  1. define("URL", "https://api.myidentitypay.com/api/v1/biometrics/merchant/data/verification/nin_wo_face"); //(此端点可以从Myidentity pass文档网站获取,不同功能有不同的端点,例如示例端点是NIN)

可以将这两个参数传递给MyIdentityPass类中可用的dataVerification方法,如下所示

            function dataVerification($number,$url,$api_key){
                    $ch = curl_init();
                    curl_setopt($ch, CURLOPT_URL,$url);
                    curl_setopt($ch, CURLOPT_POST, true);
                    curl_setopt($ch, CURLOPT_POSTFIELDS, 
                             http_build_query(array('number' => $number)));
                    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                        "X-API-Key: $api_key",
                        "Cache-Control: no-cache",
                      ));
                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                    $server_output = curl_exec($ch);

                    curl_close ($ch);
                    return $server_output;
                }

我只使用arrayPrinter方法查看我的JSON响应