card91_plugin_v2 0.0.3 copy "card91_plugin_v2: ^0.0.3" to clipboard
card91_plugin_v2: ^0.0.3 copied to clipboard

A card91 common package for different features and services.

Card91 issue card flutter plugin #

This package is used to issue card for a customer based on the validated input taken on the form. This package directly communicates to Card91 SDK.

Features #

Package directly communicate with the SDK (secured platform) to issue card and create a card holder.

Getting started #

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

Use this package as a library #

Run this command: With Flutter:

flutter pub add card91_plugin_v2

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

import 'package:card91_plugin_v2/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 OnBoarding extends StatefulWidget  {
  const OnBoarding({Key? key}) : super(key: key);

  @override
  State<OnBoarding> createState() => _OnBoardingState();
}

class _OnBoardingState extends State<OnBoarding> {
  final Card91Controller _controller = Card91Controller();// create a instance of the Card91Controller which helps calling the SDK required function
  String env=""; /// SANDBOX or PROD 
  String templateId=""; // template id will be provide separately 
  String cardProgramId="";// eg.230528190350397ID1CP9723194, card ID
  String organizationId=""; // eg. 230526135544169ID1OID4070270, Organization id 
  String uniqueId="";// eg . unique, Unique Identifier
  String authUrl=""; // Auth url which all application has to configure in order to get the business token
  String cardMode=""; // eg. DIGITAL_ONLY_CARD, type of card user wanted to generate
  String customFields="{\"step1\":[{\"name\":\"fullName\",\"displayText\":\"Full Name\",\"elements\":{\"type\":\"text\",\"defaultValue\":\"\"}},{\"name\":\"mobile\",\"displayText\":\"Mobile No.\",\"elements\":{\"type\":\"text\",\"defaultValue\":\"\"}},{\"name\":\"pan\",\"displayText\":\"PAN\",\"elements\":{\"type\":\"text\",\"defaultValue\":\"\"}},{\"name\":\"nameOnCard\",\"displayText\":\"Name on card\",\"elements\":{\"type\":\"text\",\"defaultValue\":\"\"}}]}";

  @override
  void initState() {

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: SingleChildScrollView(
            child: Container(
                color: Colors.black12,
              child: Column(
                children: [

                  IconButton(
                    onPressed: (){
                      _controller.callStep!("step2");
                    },
                    icon: Icon(
                      Icons.adb_outlined,
                      size: 30,
                      color: AppColors.blackFont,
                    ),
                  ),
                  const SizedBox(height: 20,),
                  IssueCard(
                      env: env,
                      templateId: templateId,
                      cardProgramId: cardProgramId,
                      organizationId: organizationId,
                      uniqueId: uniqueId,
                      authUrl: authUrl,
                      cardMode: cardMode,
                      customFields: customFields,
                      card91controller: _controller,
                      onDataResponse: (String dataResponse) {
                        print("Data response from SDK--->$dataResponse");
                      },),

                  // const SponsoredWidget(),
                ],
              ),
            ),
          ),
        // const LoadingIndicatorConsumer<HomeViewModel>()
    );
  }
}


Sample steps JSON for "customFields" param #

{
    "step1": [
        {
            "name": "fullName",
            "displayText": "Full Name",
            "elements": {
                "type": "text",
                "defaultValue": ""
            }
        },
        {
            "name": "mobile",
            "displayText": "Mobile No.",
            "elements": {
                "type": "text",
                "defaultValue": ""
            }
        },
        {
            "name": "pan",
            "displayText": "PAN",
            "elements": {
                "type": "text",
                "defaultValue": ""
            }
        },
        {
            "name": "nameOnCard",
            "displayText": "Name on card",
            "elements": {
                "type": "text",
                "defaultValue": ""
            }
        }
    ]
}

For Issue Card takes the following props:

Input props #

Name Type Required Description
templateId string true Use to indicate key for design template
environment string false Use "SANDBOX" for production sandbox environment and "PROD" for production environment .
cardProgramId string true Customer Card program id which come when you login with MPIN/Auth token
organizationId string true Need to pass business id
uniqueId string true Need to pass secret key auth url validation
authUrl string true Auth Url from client need pass in responses attached with token
onSubmit string true Methods used to trigger submit button through web view
customFields object true Fields which represent which step have to show
step string true Steps indicates which represent active step of issue card form
cardMode string true value should be DIGITAL_ONLY_CARD / PHYSICAL_NAMED_CARD

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_v2

Use this package as a library #

Run this command: With Flutter:

flutter pub add card91_plugin_v2

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

import 'package:card91_plugin_v2/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="";/// 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 #

Name Type Required Description
template string true Use to indicate key for design template
env string true Use "SANDBOX" for production sandbox environment and "PROD" for production environment .
mobile string true Card holder mobile number
onDataResponse call back function true In order to get the callback event from the SDK

The events are as follows:

The events are as follows:

[block:parameters] { "data": { "h-0": "Event Name", "h-1": "Description", "0-0": "C91_MIN_KYC_INITIALISED", "0-1": "The NSDL MIN KYC screen has been initialised.", "1-0": "C91_MIN_KYC_SUCCESS", "1-1": "The API request related to the NSDL MIN KYC screen was successful.", "2-0": "C91_MIN_KYC_API_FAILURE", "2-1": "The API request related to theNSDL MIN KYC screen has failed.", "3-0": "C91_MIN_KYC_AUTHENTICATION_FAILURE", "3-1": "Authentication for the NSDL MIN KYC screen has failed.", "4-0": "C91_MIN_KYC_SERVER_FAILURE", "4-1": "The server encountered an error while processing the NSDL MIN KYC request.", "5-0": "C91_MIN_KYC_MISSING_PARAMETER", "5-1": "A required parameter is missing in the NSDL MIN KYC request.", "6-0": "C91_MIN_KYC_OTP_SEND_FAIL", "6-1": "The API request for generating the OTP for the NSDL MIN KYC has failed.", "7-0": "C91_MIN_KYC_OTP_VERIFICATION_FAIL", "7-1": "The API request for validating the OTP has failed for the NSDL MIN KYC", "8-0": "C91_MIN_KYC_MOBILE_ALREADY_EXIST_OR_INVALID", "8-1": "KYC for this mobile number is already done or the mobile number is not valid. \nPayload of both these event will be different." }, "cols": 2, "rows": 9, "align": [ "left", "left" ] } [/block]

Card91 reset atm pin plugin #

This package is used to change the ATM pin of the card associated with card91 card holders. This package directly communicates to Card91 SDK.

Features #

Package directly communicate with the SDK (secured platform) to change the ATM Pin of the card.

Getting started #

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

Use this package as a library #

Depend on it Run this command: With Flutter: $ flutter pub add card91_reset_atmpin

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get): dependencies:card91_reset_atmpin: (updated version)

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it Now in your Dart code, you can use: import 'package:card91_reset_atmpin/card91_reset_atm_pin.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

import 'package:card91_reset_atmpin/card91_reset_atmpin.dart';

Get.to(
    () => Card91ResetAtmPinSuper(
    cardId: "##@^#^#@^@^",
    token: "@%%@Y@FYFHFH@GFHH@GH",
    phoneNumber:"+91-98******12",
    env: "PROD",
    onDataResponse:(String response){
    setState(() => print("Response from package =$response"));
    }
));

Input parameter for CardViewItemWidget #

Name Type Required Description
cardId string true cardId which has been received form login token service (Card91 API)
token string true Auth Token received from the Card91 APIs
phoneNumber string true Mobile number of the card holder ( format +91-88******23 )
env string true based on env base url for webview will change eg. PROD, PROD_SANDBOX
onDataResponse Function true Add a call back function to receive the error & success event

Basic call back event type #


Event Types that can be handled

"C91_RESET_PIN_SUCCESS":Called when the server-side APIs load successfully. At this time, ATM pin change is successfully done..

"C91_RESET_PIN_OTP_SCREEN_INITIALISED": Called when the server-side ATM pin changes OTP screen loads successfully.

Card91 card view plugin #

This package is made to utilize to display the card details which includes the card number, expiry and the CVV associated with card. This package directly communicates to Card91 SDK to fetch the card details issued to the cardholder.

Features #

Package directly communicate with the SDK (secured platform) with provided details basic details
of the card and in return package display the card details

Getting started #

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

Use this package as a library #

Depend on it
Run this command:
With Flutter:
$ flutter pub add card91_webview

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):
dependencies:card91_webview: (updated version)

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it
Now in your Dart code, you can use:
import 'package:card91_webview/card91_webview.dart';

Usage #

Add the widget on the specified container as child specifically as per the your design choice. Check out the below code snippet for the same. Since the card may be multiple so try to add the CardViewItemWidget inside the PageView builder and then within itembuilder add the CardViewItemWidget

Sample code below

import 'package:card91_webview/card91_webview.dart';

PageView.builder(
    itemBuilder:(context, index)
    {
        return Column
        (

            children:[
                Center(
                child: CardViewItemWidget(
                cardId: "", // provide card id here 
                customerId: "", // Customer id
                cardLastFourDigit: "", // last four digit of the card for which details need to be loaded
                token: "", // auth token needs to be provided here 
                nameOnCard: "", // provide name on card value here
                templateId: "default", // based on card layout and function selected
                env:"PROD", // based on env base url for webview will change eg. PROD, PROD_SANDBOX
                cardImageUrl: "https:XXXXXXXX", // card  background image user needs to be added her 
                onDataResponse:(String response){
                setState(() => print("Repose from package$response"));
                }),
                )
            ]
        )
    }
)

Input parameter for CardViewItemWidget #

Name Type Required Description
cardId string true cardId which has been received form login token service (Card91 API)
customerId string true customerId from the Card91 Login token API
cardLastFourDigit string true cardId which has been received form login token service (Card91 API)
token string true Auth Token received from the Card91 APIs
nameOnCard string true Name of the customer to appear in the CardView
templateId string true Look and feel of the card based on templateId, Bydefault its "default"
env string true based on env base url for webview will change eg. PROD, PROD_SANDBOX
cardImageUrl string true Card Background URL
onDataResponse Function true Add a call back function to receive the error & success event

Basic call back event type #

Event Types that can be handled

Event Name Description
C91_CARD_DETAILS_FETCH_SUCCESS Called when the server-side APIs load successfully. At this time, the card details are available, but they will be masked if no call to action has been triggered.
C91_CARD_DETAILS_FETCH_FAILURE Called when the server-side APIs fail to load. An error message would be visible in the CardView.
C91_CARD_NUMBER_SHOWN Called upon the successful operation of the showNumber trigger. At this time, the card number and the expiry date are un-masked and the CVV is masked.
C91_CARD_CVV_SHOWN Called upon the successful operation of the showCVV trigger. At this time, the CVV is un-masked and the card number and the expiry date are masked.
C91_CARD_AUTHENTICATION_FAILURE Call back event type when client is passing incorrect or expired auth token
C91_CARD_MISSING_PARAMETER Call back event type when client is not passing any required/blank parameter .
C91_CARD_SERVER_FAILURE Call back event type when there is server service exception with error code 500 to 599

Card91 Transaction List plugin #

This package is used to list the transaction of the card associated with card91 card holders. This package directly communicates to Card91 SDK.

Features #

Package directly communicate with the SDK (secured platform) to check the transaction the card.

Getting started #

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

Use this package as a library #

Depend on it Run this command: With Flutter: $ flutter pub add card91_transaction

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get): dependencies:card91_transaction: (updated version)

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it Now in your Dart code, you can use: import 'package:card91_transaction/card91_transaction.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

import 'package:card91_transaction/card91_transaction.dart';

Get.to(() => Card91Transaction(
    cardId: "@#@#@#", // User card id should be passed here
    token: "@#@#23232", // Customer auth token should be passed here
    template: "xoltt", // 
    env: "PROD", //based on env base url for webview will change eg. PROD, PROD_SANDBOX
    onDataResponse:(String response){
    setState(() => print("Response from package =$response"));
    }
));

Input parameter for CardViewItemWidget #

Name Type Required Description
cardId string true cardId which has been received form login token service (Card91 API)
token string true Auth Token received from the Card91 APIs
template string true default value would be "xoltt"
env string true based on env base url for webview will change eg. PROD, PROD_SANDBOX
onDataResponse Function true Add a call back function to receive the error & success event

Basic call back event type #

Event Name Description
c91_TXN_SCREEN_SUCCESS Called when the server-side APIs load successfully. At this time, Transaction list is successfully .
C91_TXN_AUTHENTICATION_FAILURE Call back event type when client is passing incorrect or expired auth token.
C91_TXN_MISSING_PARAMETER Call back event type when client is not passing any required/blank parameter .
C91_TXN_SERVER_FAILURE Call back event type when there is server service exception with error code 500 to 599
C91_TXN_SCREEN_INITIALISED Called when the server-side ATM pin changes OTP screen loads successfully.
C91_TXN_API_FAILURE Called when the server-side api failed.
1
likes
110
pub points
52%
popularity

Publisher

unverified uploader

A card91 common package for different features and services.

Homepage

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

flutter, get, http, http_parser, open_file_plus, path_provider, pdf, webview_flutter

More

Packages that depend on card91_plugin_v2