All Projects → cholojuanito → credit_card_validator

cholojuanito / credit_card_validator

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

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to credit card validator

open route service
An encapsulation made around openrouteservice API for Dart and Flutter projects. Made for easy generation of Routes and Directions on Maps, Isochrones, Time-Distance Matrix, Pelias Geocoding, POIs, Elevation and routing Optimizations using their amazing API.
Stars: ✭ 20 (+5.26%)
Mutual labels:  dart-library, flutter-package, dart-package
dartexif
Dart package to decode Exif data from tiff, jpeg and heic files
Stars: ✭ 16 (-15.79%)
Mutual labels:  dart-library, flutter-package, dart-package
Flogs
An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.
Stars: ✭ 158 (+731.58%)
Mutual labels:  dart-library, flutter-package, dart-package
flutter sliding tutorial
User onboarding library with smooth animation of objects and background colors
Stars: ✭ 127 (+568.42%)
Mutual labels:  dart-library, flutter-package, dart-package
Motion-Tab-Bar
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.
Stars: ✭ 237 (+1147.37%)
Mutual labels:  dart-library, flutter-package, dart-package
barcode.flutter
barcode generate library for Flutter
Stars: ✭ 58 (+205.26%)
Mutual labels:  dart-library, flutter-package
bloc
A predictable state management library that helps implement the BLoC design pattern
Stars: ✭ 12 (-36.84%)
Mutual labels:  dart-library, flutter-package
l
Cross-platform html/io [L]ogger with simple API.
Stars: ✭ 26 (+36.84%)
Mutual labels:  dart-library, dart-package
validated
Ultimate dart / flutter string validators 💃💃
Stars: ✭ 21 (+10.53%)
Mutual labels:  dart-library, dart-package
wasm.dart
WebAssembly virtual machine for Dart [work in progress]
Stars: ✭ 43 (+126.32%)
Mutual labels:  dart-library, flutter-package
crypton
A simple Dart library for asymmetric encryption and digital signatures
Stars: ✭ 25 (+31.58%)
Mutual labels:  dart-library, dart-package
dgraph
Dgraph Dart client which communicates with the server using gRPC.
Stars: ✭ 27 (+42.11%)
Mutual labels:  dart-library, flutter-package
flutter ume
UME is an in-app debug kits platform for Flutter. Produced by Flutter Infra team of ByteDance
Stars: ✭ 1,792 (+9331.58%)
Mutual labels:  dart-library, flutter-package
palace
server side framework for dart inspired by express.js
Stars: ✭ 32 (+68.42%)
Mutual labels:  dart-library, dart-package
Flarts
Flutter Charts
Stars: ✭ 61 (+221.05%)
Mutual labels:  flutter-package, dart-package
Getwidget
Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.
Stars: ✭ 2,555 (+13347.37%)
Mutual labels:  dart-library, dart-package
stash
Key-value store abstraction with plain and cache driven semantics and a pluggable backend architecture.
Stars: ✭ 71 (+273.68%)
Mutual labels:  dart-library, dart-package
material-color-utilities
Color libraries for Material You
Stars: ✭ 605 (+3084.21%)
Mutual labels:  dart-library, dart-package
Bloc
A predictable state management library that helps implement the BLoC design pattern
Stars: ✭ 8,214 (+43131.58%)
Mutual labels:  dart-library, flutter-package
gen lang
gen_lang is a dart library for internationalization. Extracts messages to generate dart files required by Intl, inspired by Intl_translation and Flutter i18n
Stars: ✭ 94 (+394.74%)
Mutual labels:  dart-library, flutter-package

credit_card_validator | Credit Card Validator

A Dart package that validates credit card numbers, expiration dates, and security codes (CVV/CVC) of a credit card. It also determines the type of credit card as part of the validation process.

This package should be used to quickly validate credit card data inputs and provide feedback to the user in your application's UI. It includes support for "potentially valid" inputs so that you can appropriately display the results to the user as they type.

Important: This package does not verify the information with the user's bank or credit company. Please use a payment processing service like Stripe or Braintree for true verification and validation of the user's payment info.

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

import 'package:credit_card_validator/credit_card_validator.dart';

class CreditCardValidationBloc {
    CreditCardValidator _ccValidator = CreditCardValidator()

    bool validateCreditCardInfo(string ccNum, string expDate, string cvv, ...) {
        var ccNumResults = _ccValidator.validateCCNum(ccNum);
        var expDateResults = _ccValidator.validateExpDate(expDate);
        var cvvResults = _ccValidator.validateCVV(cvv, ccNumResults.ccType);
        ...

        if(ccNumResults.isPotentiallyValid) {
            # Call UI code that shows to the user their credit card number is invalid
            displayInvalidCardNumber();
        }
    }
}

Features

  • Supported cards:
    • Visa
    • Mastercard
    • American Express
    • Discover
    • Diners Club
    • JCB
    • Union Pay
    • Maestro
    • Mir
    • Elo
    • Hiper/Hipercard

Original Repo

This package is based off of Braintree's Credit Card Validator JS package

Related Repos

Author

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

Support

If you think this package is helpful, tell your friends, give it a star on GitHub, and a like on pub.dev

"Buy Me A Pizza"

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].