Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
Implemented Shufti pro api using KYC in C#
I am struck in document type parameter.

Here if

document_type = "",

this will default shows all four document verification but i dont want debit credit card verification
In javascript its like,
"supported_types" : ["id_card","driving_license","passport"],

So how i Can use it in my below C# code

What I have tried:

using (var client = new WebClient())
           {
               var postData = new NameValueCollection();
               postData["client_id"] = "";
               postData["reference"] = Guid.NewGuid().ToString();
               postData["email"] = email;
               postData["phone_number"] = "";
               postData["country"] = "";
               postData["lang"] = "EN";
               postData["callback_url"] = "";
               postData["redirect_url"] = "";

               //string docTypeArr = "['id_card', 'driving_license', 'passport']";
               //var doctype = JsonConvert.SerializeObject(docTypeArr);
               //postData["supported_types"] = doctype;

               var sericesData = new
               {
                   document_type = "",
                   document_id_no = "",
                   document_expiry_date = "",
                   address = "",
                   first_name = "",
                   last_name = "",
                   dob = "",
                   background_checks = "0",
               };

               var jsonServicesData = JsonConvert.SerializeObject(sericesData);

               postData["verification_services"] = jsonServicesData;

               string rawData = "";
               //Sort the All request data to calculate signature
               foreach (var item in postData.AllKeys.OrderBy(k => k))
               {
                   rawData += postData[item];
               }
               //Append the secret key in the end
               rawData = rawData + "";
               //get sha256 hash for signature value by using the below function
               string hash = GetHashSha256(rawData);

               postData["signature"] = hash;

               //send the request to shuftipro
               var response = client.UploadValues("https://api.shuftipro.com", postData);
               var responseString = Encoding.Default.GetString(response);

               //print your response here
               //If want to parse the JSON response uncomment the below lines
               dynamic stuff = JObject.Parse(responseString);
               VerificationURL = stuff.message;
           }
Posted
Updated 22-Sep-20 0:02am
v2

The service is requested on a "document basis".

Provide the required type and id data in the "servicesData" object:

var sericesData = new
               {
                   document_type = "driving_license",
                   document_id_no = "717171717",
                   document_expiry_date = " etc ",
                   address = " etc ",
                   first_name = "",
                   last_name = "",
                   dob = "",
                   background_checks = "0",
               };
 
Share this answer
 
Comments
faisal23 16-May-19 5:38am    
i want
document_type = ["id_card", "passport"]
In this case what should i do?
I tried using array, json string etc but it doesnt work.
Hi,
I was also searching for c# on google and i saw this topic "Shufti-pro KYC api need document_types parameter" i read your question very carefully and i search for the solution. then i find a solution for your question.
solution:
you have to add code so that it could easily do kyc and scan your id and process your work further. as I mentioned below kindly add those code accordingly for further process.

C#
var sericesData = new
               {
                   document_type = "document, passport"
                   document_id_no = "xxxxx",
                   document_expiry_date = "xx-xx-xxxx",
                   address = "xxxxxxx",
                   first_name = "xxxxxx",
                   last_name = "xxxxx",
                   dob = "xxxx",
                   background_checks = "0",
               };
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900