Giter Site home page Giter Site logo

flutter_card_io's Introduction

CardIO plugin for flutter

A Flutter plugin for iOS and Android for scanning credit cards using the camera. This uses the CardIO library for iOS and Android

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and pull requests are welcome!

Installation

First, add flutter_card_io as a dependency in your pubspec.yaml file.

iOS

Add the following key to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

NSCameraUsageDescription - Set the value to be a string describing why your app needs to use the camera (e.g. "To scan credit cards."). This string will be displayed when the app initially requests permission to access the camera.

Android

Add the following permission to your Android Manifest, located in `/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA"/>

Add card.io's open source license acknowledgments to your app's acknowledgments.

Example

  Map<String, dynamic> details = await FlutterCardIo.scanCard({
    "requireExpiry": true,
    "scanExpiry": true,
    "requireCVV": true,
    "requirePostalCode": true,
    "restrictPostalCodeToNumericOnly": true,
    "requireCardHolderName": true,
    "scanInstructions": "Hola! Fit the card within the box",
  });

Response

{
    "cardholderName": "John doe",
    "cardNumber": "1234 5678 9876 1236",
    "redactedCardNumber": "**** **** **** 1236",
    "expiryMonth": 12,
    "expiryYear": 2022,
    "cvv": 123,
    "postalCode": "93748"
}

flutter_card_io's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter_card_io's Issues

How to discard scanned credit cards

Hi,

I am using the credit card scanner. However, it cannot read cardHolderName and after using the scanner for the first time, I cannot discard the scanned card image.

Is there a way to do this?

DART 2 INCOMPATIBLE

This is terrible, are you going to update this at all? This seems to be a widely needed plugin, but it is not maintained.

Stop work in Release Mode

I compile every time in debug mode and I can run in my phone very well.
When compile with release mode, I cant start the APP on phone.
If remove dependecy, work again in release mode.

I have this line:
<uses-permission android:name="android.permission.CAMERA" >, it is not the case.

in dependencies:

 flutter_card_io:
    git:
      url: https://github.com/procedurallygenerated/flutter_card_io.git

What more I need to work in release mode ?

No result from Card.io Activity

Has anyone got this working on Android API 25 and higher? I don't get the result from the Card.io activity.
Any ideas?
Thanks

Reloading automatically many times using FutureBuilder

I am using a FutureBuilder with the scan card method, but when I finish the scan, the scan card screen shows again, I accept the new scan, but scan card screen shows again, the cycle never finishes until I cancel the scan. This is a snippet of my code:

  Future<bool> _scanCard() async {
    bool ok = false;
    Map<String, dynamic> result = await FlutterCardIo.scanCard({
      "requireExpiry": true,
      "scanExpiry": true,
      "requireCVV": false,
      "requirePostalCode": false,
      "restrictPostalCodeToNumericOnly": false,
      "requireCardHolderName": false,
      "scanInstructions": R.s("scanCardTitle")
    });
   ok = true;
}

 @override
 Widget build(BuildContext context) {
      return FutureBuilder(future: _scanCard(),
          builder: (BuildContext context, AsyncSnapshot snapshot) {
            if (snapshot.hasData) {
              return _customBuilder(context);
            }
            else return CircularProgressIndicator();
          });
 }

I will be very thankful if anyone shares an idea or solution. Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.