MIN KYC NSDL Flutter Plugin

Card91 min KYC flutter plugin

This package is used to complete the min KYC of the customer who has NSDL cards. This package directly communicates to Card91 SDK.

Features

Package directly communicate with the SDK (secured platform) to complete the min KYC of a card holder.

Getting started

Add the widget package on your pubspec version
$ flutter pub add card91_plugin

Use this package as a library

Run this command: With Flutter:

flutter pub add card91_plugin

Import it
Now in your Dart code, you can use:

import 'package:card91_plugin/card91_flutter_library.dart';

Usage

Open the widget by passing the required parameter to use it. Check out the below code snippet for the same.
Sample code below


class OnBoardingKYC extends StatefulWidget  {
  const OnBoardingKYC({Key? key}) : super(key: key);

  @override
  State<OnBoardingKYC> createState() => _OnBoardingKYCState();
}

class _OnBoardingKYCState extends State<OnBoardingKYC> {

  String env="";/// PROD_SANDBOX or PROD 
  String templateId="";///template id will be provide separately 
  String mobile=""; //eg. 91***2077430, card holder mobile number

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: SingleChildScrollView(
            child: Column(
              children: [
                const SizedBox(height: 20,),
                SizedBox(
                  height: MediaQuery.of(context).size.height,
                  width: MediaQuery.of(context).size.width,
                  child: CardKYCFunction(
                      env: env,
                      template: templateId,
                      mobile: mobile,
                      onDataResponse: (String dataResponse) {
                      switch (dataResponse) {
                        case "C91_MIN_KYC_INITIALISED":
                          // Do something to indicate that library is initialized
                          break;
                        case "C91_MIN_KYC_SUCCESS":
                           // Do something to indicate that the API calls have succeeded
                          break;
                        case "C91_MIN_KYC_API_FAILURE":
                          // Do something to indicate that the API calls have failed
                          break;
                        case "C91_MIN_KYC_AUTHENTICATION_FAILURE":
                         // Do something to indicate that the API calls have Unauthorized
                          break;
                        case "C91_MIN_KYC_SERVER_FAILURE":
                           // Do something to indicate that the API calls have Server Error
                          break;
                        case 'C91_ISSUE_CARD_API_FAILURE':
                          // Do something to indicate that the API calls have failed
                          break;
                         case "C91_MIN_KYC_MISSING_PARAMETER":
                           // Do something to indicate that Parameter is missing
                          break;
                        case "C91_MIN_KYC_OTP_SEND_FAIL":
                          // Do something to indicate that the API fails to send the OTP
                          break;
                        case "C91_MIN_KYC_OTP_VERIFICATION_FAIL":
                          // Do something to indicate that the API MIN KYC Verification is failed
                          break;
                        case 'C91_MIN_KYC_MOBILE_ALREADY_EXIST_OR_INVALID':
                          // Do something to indicate that the KYC already done or mobile number invalid 
                         // Check the payload to identify the two cases here 

                      }
                   },),
                ),
              ],
            ),
          ),
       
    );
  }
}



For Issue Card takes the following props:

Input props

NameTypeRequiredDescription
templatestringtrueUse to indicate key for design template
envstringtrueUse "SANDBOX" for production sandbox environment and "PROD" for production environment .
mobilestringtrueCard holder mobile number
onDataResponsecall back functiontrueIn order to get the callback event from the SDK

The events are as follows:

Event NameDescription
C91_MIN_KYC_INITIALISEDThe NSDL MIN KYC screen has been initialised.
C91_MIN_KYC_SUCCESSThe API request related to the NSDL MIN KYC screen was successful.
C91_MIN_KYC_API_FAILUREThe API request related to theNSDL MIN KYC screen has failed.
C91_MIN_KYC_AUTHENTICATION_FAILUREAuthentication for the NSDL MIN KYC screen has failed.
C91_MIN_KYC_SERVER_FAILUREThe server encountered an error while processing the NSDL MIN KYC request.
C91_MIN_KYC_MISSING_PARAMETERA required parameter is missing in the NSDL MIN KYC request.
C91_MIN_KYC_OTP_SEND_FAILThe API request for generating the OTP for the NSDL MIN KYC has failed.
C91_MIN_KYC_OTP_VERIFICATION_FAILThe API request for validating the OTP has failed for the NSDL MIN KYC
C91_MIN_KYC_MOBILE_ALREADY_EXIST_OR_INVALIDKYC for this mobile number is already done or the mobile number is not valid.
Payload of both these event will be different.