savepopulation / creditcard-validator

A simple credit card validation and format library for most popular credit cards in the world.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

creditcardvalidator

A simple credit card validation and format library for most popular credit cards in the world.

How to use?

1- Setup your validator:

CreditCardValidator creditCardValidator = new CardValidatorBuilder()
                .addVisaCardValidator()
                .addMasterCardValidador()
                .addAmexCardValidator()
                .addDiscoverCardValidator()
                .addDinClubCardValidator()
                .addJcbCardValidator()
                .setTypeChangeListener(this)
                .setValidationChangeListener(this)
                .setFormatable(true)
                .build();

2- Add it to your EditText:

final EditText editTextCardNumber = (EditText) findViewById(R.id.edittext_card_number);
editTextCardNumber.addTextChangedListener(creditCardValidator);

About

A simple credit card validation and format library for most popular credit cards in the world.

License:Apache License 2.0


Languages

Language:Java 100.0%