All Projects → sualeh → creditcardnumber

sualeh / creditcardnumber

Licence: other
Java library that can provide details of a bank issued credit card number

Programming Languages

java
68154 projects - #9 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to creditcardnumber

paymentgateway
Dokumentace ČSOB platební brány a jejího eAPI pro platby platebními kartami, Apple Pay, mallpay a platebními tlačítky ČSOB.
Stars: ✭ 104 (+141.86%)
Mutual labels:  payments, payment-processing
Braintree android
Braintree SDK for Android
Stars: ✭ 343 (+697.67%)
Mutual labels:  credit-card, payments
cybersource-android-sdk
The CyberSource InApp SDK enables developers to simply and securely incorporate mobile payments into their Android applications.
Stars: ✭ 25 (-41.86%)
Mutual labels:  payments, payment-processing
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (-4.65%)
Mutual labels:  payments, payment-processing
Offset
Offset payment engine
Stars: ✭ 152 (+253.49%)
Mutual labels:  credit-card, payments
adyen-salesforce-commerce-cloud
Salesforce Commerce Cloud (formerly Demandware)
Stars: ✭ 63 (+46.51%)
Mutual labels:  payments, payment-processing
Android Card Form
A ready-made card form layout that can be included in your Android app, making it easy to accept credit and debit cards.
Stars: ✭ 310 (+620.93%)
Mutual labels:  credit-card, payments
card-validator
Card validation helpers for payment forms.
Stars: ✭ 22 (-48.84%)
Mutual labels:  credit-card, payments
Card
💳 make your credit card form better in one line of code
Stars: ✭ 11,365 (+26330.23%)
Mutual labels:  credit-card, payments
Checkout Sdk Node
Checkout.com SDK for Node.js. Documentation here:
Stars: ✭ 28 (-34.88%)
Mutual labels:  credit-card, payments
Payment
💰 A jQuery-free general purpose library for building credit card forms, validating inputs and formatting numbers.
Stars: ✭ 467 (+986.05%)
Mutual labels:  credit-card, payments
mollie-api-go
Golang wrapper for Mollie's REST API with full resource coverage.
Stars: ✭ 45 (+4.65%)
Mutual labels:  payments, payment-processing
terms-dictionary
Simple definitions of terms, acronyms, abbreviations, companies, and projects related to financial services and Moov.
Stars: ✭ 48 (+11.63%)
Mutual labels:  credit-card, payments
cybersource-sdk-java
Java SDK for CyberSource Simple Order API
Stars: ✭ 44 (+2.33%)
Mutual labels:  payments, payment-processing
PaymentCardView
Custom Credit/Debit card view
Stars: ✭ 62 (+44.19%)
Mutual labels:  credit-card
lnd-routing
Lightning network liquidity service
Stars: ✭ 16 (-62.79%)
Mutual labels:  payments
python-daraja
Python Wrapper for interacting with the MPESA Daraja API. More Features to be implemented
Stars: ✭ 20 (-53.49%)
Mutual labels:  payments
eth-commerce
Javascript library to accept ethereum payments on any website
Stars: ✭ 24 (-44.19%)
Mutual labels:  payments
MugglePay
Make Crypto Payment Easy 让数字货币支付更简单
Stars: ✭ 176 (+309.3%)
Mutual labels:  payments
swift
SWIFT (payments) SDK in GO
Stars: ✭ 18 (-58.14%)
Mutual labels:  payments

Quick Build The Central Repository

Credit Card Number

Credit Card Number is a Java library that can provide details of a bank issued credit card number.

(Also see Magnetic Track Parser.)

The goal of this project is to use publicly and freely available documentation to create a reliable Java library to provide information about credit card numbers.

Resources

Some resources consulted are:

Design Principles

  • All classes are immutable and thread-safe
  • Secure data follows standards in the Java Cryptography Architecture (JCA) Reference Guide
  • The standard toString() function formats data in a readable form
  • Internationalization of card numbers is supported
  • Validity is enforced by JUnit 5 tests
  • Java 8 or newer is required
  • Android friendly

Download and Use in Projects

You can download the jar on the Maven Central Repository. The download page has instructions on how to use the library in your Maven or Gradle build.

Examples

How to Get Bank Card Information

To get bank card information, use code like:

AccountNumber pan = AccountNumbers.completeAccountNumber("5266-0922-0141-6174");
ExpirationDate expiration = new ExpirationDate(2015, 4);
Name name = new Name("Sualeh", "Fatehi");
ServiceCode serviceCode = new ServiceCode("225");
BankCard card = new BankCard(pan, expiration, name, serviceCode);
System.out.println(card);

and you will get this output:

Bank Card Information:
  Raw Account Number: 5266-0922-0141-6174
  Primary Account Number: 5266092201416174
    Major Industry Identifier: 5 - Banking and financial
    Issuer Identification Number: 52660922
    Card Brand: MasterCard
    Last Four Digits: 6174
    Passes Luhn Check? Yes
    Is Primary Account Number Valid? Yes
  Expiration Date: 2015-04
    Is Expired? Yes
  Name: Sualeh Fatehi
  Service Code:
    2 - Interchange: International interchange. Technology: Integrated circuit card.
    2 - Authorization Processing: By issuer.
    5 - Allowed Services: Goods and services only. PIN Requirements: PIN required.

How to Secure the Credit Card Number

If you need the account number information, but want to be secure by not storing the actual primary account number in memory, you can use code like:

AccountNumber pan = AccountNumbers.completeAccountNumber("5266-0922-0141-6174");
pan.dispose();
System.out.println(pan.getAccountNumber());

and you will get this output:

null

The account number is no longer retained in memory. Even though the memory has been cleared of the account number, you may want to allow the original reference to be garbage collected by doing this:

// (Call dispose() first)
AccountNumber securePan = pan.toSecureAccountNumber();

How to Encrypt the Credit Card Number

If you need the account number information, but want to encrypt it using a cryptographic algorithm such as AES, you can use code like:

AccountNumber sealedPan = AccountNumbers.sealedAccountNumber("5266-0922-0141-6174", cipher);
System.out.println(sealedPan.getAccountNumber());

and you will get this output:

null

The account number can be decrypted by doing this:

AccountNumber pan = AccountNumbers.completeAccountNumber(sealedPan, key);
System.out.println(pan.getAccountNumber());

The cipher and key are from javax.crypto and java.security.

Internationalization is Supported

You can use code like:

AccountNumber pan = AccountNumbers.completeAccountNumber("५२६६ ०९२२ ०१४१ ६१७४");
System.out.println(pan.getAccountNumber());

and you will get this output:

5266092201416174

Look-ahead Typing

The Credit Card Number library allows look-ahead typing and identifies the card brand by at least the first four digits of the card number.

You can use code like:

CardBrand cardBrand = CardBrand.from("5366");
System.out.println(cardBrand);

and you will get this output:

MasterCard
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].