The CardScan SDK is built from multiple android modules, each of which builds upon more base modules. The structure of the modules used in CardScan looks like this:
The CardScan SDK consists of these modules as well as a demo app:
The scan-camera module contains the camera interfaces for setting up the camera on the device and receiving images from it. It also handles converting the images from the camera to a processable format.
The scan-payment module contains the code for validating and managing payment cards.
The scan-ui module contains some common functionality shared between user interfaces for scanning cards. This provides the card viewfinder, debug overlay, and base scan activity.
The cardscan-ui module builds on top of the scan-ui and scan-payment modules to provide user interfaces for scanning payment cards. Anything specific to the user interface of the CardScan product lives in this library.
The cardscan-demo app provides a demonstration for launching the CardScan SDK as a separate activity and for integrating the CardScan library into an existing activity.
Check out the project using
git clone https://github.com/getbouncer/cardscan-android
To build the project, run the following command:
To create an AAR release of the app, run the following command:
This will place an AAR file in
These libraries follow a standard github contribution flow.
Create a new github feature branch
git checkout -b <your_github_name>/<your_feature_name>
Make your code changes
Push your branch to origin
git push --set-upstream origin <your_branch_name>
Create a new pull request on github, and tag appropriate owners.
Once you have approval, merge your branch into master and delete your feature branch from github.
Unit tests can be run from android studio or from the command line. To execute from the command line, run the following command:
Android tests can be run from android studio or from the command line. To execute from the command line, run the following command:
Note that these tests require that you have an emulator running or a physical device connected to your machine via
See the release documentation.