credit_card_validator 0.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new48

credit_card_validator | Credit Card Validator #

A Dart package that validates credit card numbers, expiration dates, and security codes (CVV/CVC) based on the type of credit card

Installing #

  1. Add dependency to pubspec.yaml

    Get the current version in the 'Installing' tab on pub.dartlang.org

dependencies:
    credit_card_validator: *current-version*
  1. Import the package
import 'package:credit_card_validator/credit_card_validator.dart';

Usage #

A basic example

Note: #

The CreditCardValidator class is meant to be used as a mixin and is not instantiable or extendable.

import 'package:credit_card_validator/credit_card_validator.dart';

class CreditCardValidationBloc with CreditCardValidator {
    // Your wrapper class for validating credit cards that now has access to validation functions
    // You can evaluate the results from the functions in your own functions inside this class
}

Features #

  • Supported cards:
    • Visa
    • Mastercard
    • American Express
    • Discover
    • More to come!

Author #

Tanner Davis (Cholojuanito) - Creator and repo owner - Github Profile

License #

This project is licensed under the MIT License - see the LICENSE file for more details

Up next #

  • Security code validation and unit tests

[0.0.2] - April 18, 2019

  • Expiration date validation
    • Allows for dates with the following formats:
      • MM/YYYY
      • MM/YYY will only happen when the user is typing in a 4 digit year
      • MM/YY
    • Also makes sure the expiration year isn't beyond a certain limit, default is 19

[0.0.1] - April 15, 2019

  • Initial release
  • Card number validation supported for:
    • Visa
    • American Express
    • Discover
    • MasterCard

example/README.md

Example usage #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  credit_card_validator: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:credit_card_validator/credit_card_validator.dart';
  
Version Uploaded Documentation Archive
0.0.2 Apr 18, 2019 Go to the documentation of credit_card_validator 0.0.2 Download credit_card_validator 0.0.2 archive
0.0.1 Apr 15, 2019 Go to the documentation of credit_card_validator 0.0.1 Download credit_card_validator 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Apr 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:credit_card_validator/credit_card_validator.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
credit_card_type_detector ^1.0.1 1.0.1
Dev dependencies
test ^1.5.3