Coder Social home page Coder Social logo

tapcard's Introduction

TapCard Build Status

Replace card number input with NFC tap!

Description

A Java library to let your app users enter an NFC or EMV card info in a flash – just by holding it to the back of their phone. Don’t lose clients because they hate to manually enter all the card details – this process on a phone is awkward.

Demo app available on the Google Play:

Get it on Google Play

Demo app screen

Go to GitHub repo

Getting started

Create the reader

nfcCardReader = new NFCCardReader(activity);

When you will be ready - wait for NFC card.

nfcCardReader.enableDispatch();

After this, app will activate NFC and start waiting for card. Once user is tapped phone, activity will got intent.

Check that it is right intent and pass it to library. Library processing is blocking so wrap it in async call.

You can use our Rx wrappers:

    @Override
    protected void onNewIntent(Intent intent) {
        if (nfcCardReader.isSuitableIntent(intent)) {
            textView.setText("Reading...");

            cardReadDisposable.dispose();
            cardReadDisposable = nfcCardReader
                    .readCardRx2(intent)
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribe(
                            emvCard -> fillCardNumber(emvCard.getCardNumber()),
                            throwable -> showError());
        }
    }

Don't forget to stop waiting if Activity is paused or card reading is not needed more.

nfcCardReader.disableDispatch();

Done! You got a card object, that contains all read data (Aid, card number, expiration date, card type, transactions history)

For more examples checkout samples directory of this repo

Download

Library is not published yet. But you can use it from JitPack!

Step 1. Add the JitPack repository to your build file

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2. Add the dependency

	dependencies {
		compile 'com.github.TapCard.TapCard:android:master-SNAPSHOT'
	}

or for specific commit

	dependencies {
		compile 'com.github.TapCard.TapCard:android:6673d687ba'
	}

About fork

This is a fork of EMV-NFC-Paycard-Enrollment by Millau Julien.

Fork is aimed at better Android compatibility and simpler API.

Original library is heavy using Apache libraries. So for smaller method count used methods are included inside library sources and Apache library was detached from dependencies. Also log4j was replaced with simple logging, that can be easily configured via LoggerFactory.setLogWriter(LogWriter)

Build

To build the project launch:

./gradlew build

Bugs

Please report bugs and feature requests to the GitHub issue tracker.
Forks and Pull Requests are also welcome.

Copyright and license

Copyright 2014 Millau Julien.

Copyright 2017 CkEsc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

tapcard's People

Contributors

ckesc avatar devnied avatar jamiefarrelly avatar

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.