Giter Site home page Giter Site logo

card.io-android-sdk's Introduction

Build Status

card.io SDK for Android

card.io provides fast, easy credit card scanning in mobile apps.

Stay up to date

Please be sure to keep your app up to date with the latest version of the SDK. All releases follow semantic versioning.

The latest version is available via mavenCentral(). Just add the following dependency:

compile 'io.card:android-sdk:5.5.1'

You can receive updates about new versions via a few different channels:

Also be sure to check and post to the Stack Overflow card.io tag.

Integration instructions

The information in this guide is enough to get started. For additional details, see our javadoc.

(Note: in the past, developers needed to sign up at the card.io site and obtain an app token. This is no longer required.)

Requirements for card scanning

  • Rear-facing camera.
  • Android SDK version 16 (Android 4.1) or later.
  • armeabi-v7a, arm64-v8, x86, or x86_64 processor.

A manual entry fallback mode is provided for devices that do not meet these requirements.

Setup

Add the dependency in your build.gradle:

compile 'io.card:android-sdk:5.5.0'

Sample code (See the SampleApp for an example)

First, we'll assume that you're going to launch the scanner from a button, and that you've set the button's onClick handler in the layout XML via android:onClick="onScanPress". Then, add the method as:

public void onScanPress(View v) {
    Intent scanIntent = new Intent(this, CardIOActivity.class);

    // customize these values to suit your needs.
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: false
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false); // default: false
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false

    // MY_SCAN_REQUEST_CODE is arbitrary and is only used within this activity.
    startActivityForResult(scanIntent, MY_SCAN_REQUEST_CODE);
}

Next, we'll override onActivityResult() to get the scan result.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == MY_SCAN_REQUEST_CODE) {
        String resultDisplayStr;
        if (data != null && data.hasExtra(CardIOActivity.EXTRA_SCAN_RESULT)) {
            CreditCard scanResult = data.getParcelableExtra(CardIOActivity.EXTRA_SCAN_RESULT);

            // Never log a raw card number. Avoid displaying it, but if necessary use getFormattedCardNumber()
            resultDisplayStr = "Card Number: " + scanResult.getRedactedCardNumber() + "\n";

            // Do something with the raw number, e.g.:
            // myService.setCardNumber( scanResult.cardNumber );

            if (scanResult.isExpiryValid()) {
                resultDisplayStr += "Expiration Date: " + scanResult.expiryMonth + "/" + scanResult.expiryYear + "\n";
            }

            if (scanResult.cvv != null) {
                // Never log or display a CVV
                resultDisplayStr += "CVV has " + scanResult.cvv.length() + " digits.\n";
            }

            if (scanResult.postalCode != null) {
                resultDisplayStr += "Postal Code: " + scanResult.postalCode + "\n";
            }
        }
        else {
            resultDisplayStr = "Scan was canceled.";
        }
        // do something with resultDisplayStr, maybe display it in a textView
        // resultTextView.setText(resultDisplayStr);
    }
    // else handle other activity results
}

Hints & Tips

  • Javadocs are provided in this repo for a complete reference.
  • Note: the correct proguard file is automatically imported into your gradle project from the aar package. Anyone not using gradle will need to extract the proguard file and add it to their proguard config.
  • card.io errors and warnings will be logged to the "card.io" tag.
  • If upgrading the card.io SDK, first remove all card.io libraries so that you don't accidentally ship obsolete or unnecessary libraries. The bundled libraries may change.
  • Processing images can be memory intensive.
  • card.io recommends the use of SSL pinning when transmitting sensitive information to protect against man-in-the-middle attacks.

Contributing

Please read our contributing guidelines prior to submitting a Pull Request.

License

Please refer to this repo's license file.

card.io-android-sdk's People

Contributors

ben-j69 avatar braebot avatar jgabrielfreitas avatar lkorth avatar mattjacunski avatar mettler avatar priteshshah1983 avatar sankarbhavanib avatar semanticart avatar tomwhipple avatar vinc3m1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

card.io-android-sdk's Issues

Crash. Start card.io activity on some devices

In crash report from production we received report about crash in card.io library.

Exception:
io.card.payment.DataEntryActivity.onCreate java.lang.IllegalStateException: Didn't find any extras!

Code:
Intent scanIntent = new Intent(activity, CardIOActivity.class);

    // required for authentication with card.io
    scanIntent.putExtra(CardIOActivity.EXTRA_APP_TOKEN, MY_CARDIO_APP_TOKEN);

    // customize these values to suit your needs.
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: true
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, true); // default: false
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false

    // MY_SCAN_REQUEST_CODE is arbitrary and is only used within this activity.
    activity.startActivityForResult(scanIntent, requestCode);

Device info:

4.1.1
ANDROID VERSION
Yes
ROOTED
Portrait
UI ORIENTATION
UNKNOW
DEVICE

Funcation CardIOActivity.canReadCardWithCamera(this) returns false

Hey , so i've made this android project named 'Demo Application'and added the jar files into my libs folder and import that into my Demo Application . Now What else do i need to do so as to make the Method return valure true , CardIOActivity.canReadCardWithCamera(this) is always returning false.

Exception when using with ActionBarSherlock

Hi (also emailed to card.io support)

I’m trying to integrate card.io into our Android App. I am getting the exception listed in the stack trace that follows.

I have all the permissions requested in the manifest as listed on github. I have lifted the code from your own sample too just to make sure. I get this exception every time when trying to start your DataEntryActivity. I can build and run the sample app just fine.

This seems to be linked to use of ActionBarsherlock. I have found this similar issue https://code.google.com/p/android/issues/detail?id=66120 Unfortunately I'm not able to extend DataEntryActivity as it is marked final.

Any help here would be appreciated.

Many thanks

Richard

07-20 08:22:13.298: E/card.io(26120): Unkown exception - please send the stack trace to [email protected]
07-20 08:22:13.298: E/card.io(26120): android.util.AndroidRuntimeException: requestFeature() must be called before adding content
07-20 08:22:13.298: E/card.io(26120): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:318)
07-20 08:22:13.298: E/card.io(26120): at android.app.Activity.requestWindowFeature(Activity.java:3385)
07-20 08:22:13.298: E/card.io(26120): at io.card.payment.CardIOActivity.onCreate(Unknown Source)
07-20 08:22:13.298: E/card.io(26120): at android.app.Activity.performCreate(Activity.java:5426)
07-20 08:22:13.298: E/card.io(26120): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
07-20 08:22:13.298: E/card.io(26120): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
07-20 08:22:13.298: E/card.io(26120): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
07-20 08:22:13.298: E/card.io(26120): at android.app.ActivityThread.access$900(ActivityThread.java:161)
07-20 08:22:13.298: E/card.io(26120): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
07-20 08:22:13.298: E/card.io(26120): at android.os.Handler.dispatchMessage(Handler.java:102)
07-20 08:22:13.298: E/card.io(26120): at android.os.Looper.loop(Looper.java:157)
07-20 08:22:13.298: E/card.io(26120): at android.app.ActivityThread.main(ActivityThread.java:5356)
07-20 08:22:13.298: E/card.io(26120): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 08:22:13.298: E/card.io(26120): at java.lang.reflect.Method.invoke(Method.java:515)
07-20 08:22:13.298: E/card.io(26120): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
07-20 08:22:13.298: E/card.io(26120): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
07-20 08:22:13.298: E/card.io(26120): at dalvik.system.NativeStart.main(Native Method)

card.io sample app not working

Hello there.
I have downloaded card.io SampleApp for Android.
However, application doesn't work. Why? Hardly to say.
I have followed all steps show in your documentation, which is, by the way, fantastic.
I have tried everything: from removing android:hardwareAccelerated=true, to setting it on false, but nothing, camera just didn't took a shot.
I have noticed that in manifest, there is something like this:

 android:name="android.hardware.camera" android:required="false"
 android:name="android.hardware.camera.autofocus" android:required="false"

I have tried to to set that to true too, but nothing. No luck.
I have tested on Nexus 5, and Samsung Galaxy S5, and I had same results.
Please help, and thanks in advance.
Sign: desprate developer :(

Card.IO is not accepting Diner's Club cards

Hi,

Card.Io is only taking card numbers starting from 34, 35 and 37

its not taking other numbers starting from digit 3 where as diners cards starts from 30, 36 or 38.

I reviewed the iOS issues for this, i guess you guys fixed this in iOS.

Ability to pass custom extras

Is there the ability to pass custom extras to the CardIOActivity and get them back in onActivityResult? Might be a nice feature

Eclipse project

How can i import sdk in eclipse..please provide link or steps for that.
Thanks

Problems with cards recognize

We are using card.io library in our project. And we have problems with it. The credit cards recognized very slowly and uncorrectly. Example:

  1. We using this example card: http://trademark.ua/wp-content/uploads/2013/03/torgovaya-marka-visa.jpg
    On Android and iOS devices this card recognized in 10-15 seconds and some digits recognized wrong (7 as 2 and 8 as 6).
  2. We using this example card: http://www.creditcardchaser.com/wp-content/uploads/2010/11/nyu-credit-card.jpg
    and it's not recognized.
  3. We using real credit cards - first is green with black digits, and second is grey with black digits. Android example from GitHub isn't recognized it, but iOS example app reconized it in 1-2 minutes, but some digits are wrong.
    We change lighting in the ofice, use different cards positions, but no one card is recognized correctly.

Orientation Lock

Is there a way to lock the orientation to portrait (ie I don't want the rectangle and logo to move on the camera view when the device is rotated. Why - My app is portrait only)?

I have tried setting in the manifest with no success:

android:configChanges="orientation"
android:screenOrientation="portrait"

Missing cancel button

If I setup card.io with the following parameters, I arrive at an interesting problem: the lack of an escape/cancel button (the first 2 parameters may be all that matter).

scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_CONFIRMATION, true);
scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, false);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false);
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false);

At this point I am forced to make a card scan happen or I must use the native android back button. I assume since iOS doesn't have a native back button then one must have been added to that code base. Would it be possible make a back button optional on android? (Target audience would be devices in kiosk mode that have had the hardware buttons disabled and soft keys hidden.)

Optional postal code

Can you add support for an optional postal code? Some of our international users don't have or know theirs (and the banks don't require it).

crashes with native exception when trying to start CardIO Activity

native trace here from logcat. If it matters we are using multidex

W/linker  (10217): libopencv_core.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
W/linker  (10217): libopencv_imgproc.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
F/art     (10217): art/runtime/verifier/method_verifier.cc:3321] Check failed: !Thread::Current()->IsExceptionPending() 
F/art     (10217): art/runtime/verifier/method_verifier.cc:3321] Check failed: !Thread::Current()->IsExceptionPending() 
F/art     (10217): art/runtime/runtime.cc:284] Runtime aborting --- recursively, so no thread-specific detail!
F/art     (10217): art/runtime/runtime.cc:284] 
F/libc    (10217): Fatal signal 6 (SIGABRT), code -6 in tid 10217 (.airbnb.android)
I/DEBUG   (  181): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  181): Build fingerprint: 'google/hammerhead/hammerhead:5.0.1/LRX22C/1602158:user/release-keys'
I/DEBUG   (  181): Revision: '11'
I/DEBUG   (  181): ABI: 'arm'
I/DEBUG   (  181): pid: 10217, tid: 10217, name: .airbnb.android  >>> com.airbnb.android <<<
I/DEBUG   (  181): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/DEBUG   (  181): Abort message: 'art/runtime/verifier/method_verifier.cc:3321] Check failed: !Thread::Current()->IsExceptionPending() '
I/DEBUG   (  181):     r0 00000000  r1 000027e9  r2 00000006  r3 00000000
I/DEBUG   (  181):     r4 b6f2a114  r5 00000006  r6 00000002  r7 0000010c
I/DEBUG   (  181):     r8 00000001  r9 b504f520  sl b5007800  fp 9eade240
I/DEBUG   (  181):     ip 000027e9  sp bef294c8  lr b6eb4af9  pc b6ed7c24  cpsr 60070010
I/DEBUG   (  181): 
I/DEBUG   (  181): backtrace:
I/DEBUG   (  181):     #00 pc 00039c24  /system/lib/libc.so (tgkill+12)
I/DEBUG   (  181):     #01 pc 00016af5  /system/lib/libc.so (pthread_kill+52)
I/DEBUG   (  181):     #02 pc 00017707  /system/lib/libc.so (raise+10)
I/DEBUG   (  181):     #03 pc 00013f75  /system/lib/libc.so (__libc_android_abort+36)
I/DEBUG   (  181):     #04 pc 00012a3c  /system/lib/libc.so (abort+4)
I/DEBUG   (  181):     #05 pc 00226033  /system/lib/libart.so (art::Runtime::Abort()+170)
I/DEBUG   (  181):     #06 pc 000a72e9  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
I/DEBUG   (  181):     #07 pc 0025629d  /system/lib/libart.so (art::verifier::MethodVerifier::GetQuickInvokedMethod(art::Instruction const*, art::verifier::RegisterLine*, bool)+280)
I/DEBUG   (  181):     #08 pc 0025a66b  /system/lib/libart.so (art::verifier::MethodVerifier::VerifyInvokeVirtualQuickArgs(art::Instruction const*, bool)+50)
I/DEBUG   (  181):     #09 pc 0025e7c3  /system/lib/libart.so (art::verifier::MethodVerifier::CodeFlowVerifyInstruction(unsigned int*)+4918)
I/DEBUG   (  181):     #10 pc 00260323  /system/lib/libart.so (art::verifier::MethodVerifier::CodeFlowVerifyMethod()+142)
I/DEBUG   (  181):     #11 pc 002607c7  /system/lib/libart.so (art::verifier::MethodVerifier::VerifyCodeFlow()+614)
I/DEBUG   (  181):     #12 pc 0026093f  /system/lib/libart.so (art::verifier::MethodVerifier::Verify()+130)
I/DEBUG   (  181):     #13 pc 00261feb  /system/lib/libart.so (art::verifier::MethodVerifier::FindLocksAtDexPc(art::mirror::ArtMethod*, unsigned int, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >*)+334)
I/DEBUG   (  181):     #14 pc 001f41e5  /system/lib/libart.so (art::Monitor::VisitLocks(art::StackVisitor*, void (*)(art::mirror::Object*, void*), void*, bool)+252)
I/DEBUG   (  181):     #15 pc 00233a07  /system/lib/libart.so (art::StackDumpVisitor::VisitFrame()+374)
I/DEBUG   (  181):     #16 pc 0022dbeb  /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+702)
I/DEBUG   (  181):     #17 pc 002361c9  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+224)
I/DEBUG   (  181):     #18 pc 00225b79  /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*)+32)
I/DEBUG   (  181):     #19 pc 00225de3  /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+354)
I/DEBUG   (  181):     #20 pc 00225fdb  /system/lib/libart.so (art::Runtime::Abort()+82)
I/DEBUG   (  181):     #21 pc 000a72e9  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
I/DEBUG   (  181):     #22 pc 0025629d  /system/lib/libart.so (art::verifier::MethodVerifier::GetQuickInvokedMethod(art::Instruction const*, art::verifier::RegisterLine*, bool)+280)
I/DEBUG   (  181):     #23 pc 0025a66b  /system/lib/libart.so (art::verifier::MethodVerifier::VerifyInvokeVirtualQuickArgs(art::Instruction const*, bool)+50)
I/DEBUG   (  181):     #24 pc 0025e7c3  /system/lib/libart.so (art::verifier::MethodVerifier::CodeFlowVerifyInstruction(unsigned int*)+4918)
I/DEBUG   (  181):     #25 pc 00260323  /system/lib/libart.so (art::verifier::MethodVerifier::CodeFlowVerifyMethod()+142)
I/DEBUG   (  181):     #26 pc 002607c7  /system/lib/libart.so (art::verifier::MethodVerifier::VerifyCodeFlow()+614)
I/DEBUG   (  181):     #27 pc 0026093f  /system/lib/libart.so (art::verifier::MethodVerifier::Verify()+130)
I/DEBUG   (  181):     #28 pc 00261feb  /system/lib/libart.so (art::verifier::MethodVerifier::FindLocksAtDexPc(art::mirror::ArtMethod*, unsigned int, std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >*)+334)
I/DEBUG   (  181):     #29 pc 001f41e5  /system/lib/libart.so (art::Monitor::VisitLocks(art::StackVisitor*, void (*)(art::mirror::Object*, void*), void*, bool)+252)
I/DEBUG   (  181):     #30 pc 00233a07  /system/lib/libart.so (art::StackDumpVisitor::VisitFrame()+374)
I/DEBUG   (  181):     #31 pc 0022dbeb  /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+702)
I/DEBUG   (  181):     #32 pc 002361c9  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+224)
I/DEBUG   (  181):     #33 pc 000b1215  /system/lib/libart.so (art::JniAbort(char const*, char const*)+620)
I/DEBUG   (  181):     #34 pc 000b1945  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+68)
I/DEBUG   (  181):     #35 pc 000b4bcd  /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1324)
I/DEBUG   (  181):     #36 pc 000b7085  /system/lib/libart.so (art::CheckJNI::GetFieldID(_JNIEnv*, _jclass*, char const*, char const*)+36)
I/DEBUG   (  181):     #37 pc 0002699b  /data/app/com.airbnb.android-1/lib/arm/libcardioRecognizer.so (JNI_OnLoad+498)
I/DEBUG   (  181):     #38 pc 001dd659  /system/lib/libart.so (art::JavaVMExt::LoadNativeLibrary(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, art::Handle<art::mirror::ClassLoader>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)+1512)
I/DEBUG   (  181):     #39 pc 0020478f  /system/lib/libart.so (art::Runtime_nativeLoad(_JNIEnv*, _jclass*, _jstring*, _jobject*, _jstring*)+534)
I/DEBUG   (  181):     #40 pc 000777f1  /data/dalvik-cache/arm/system@[email protected]
I/DEBUG   (  181): 
I/DEBUG   (  181): Tombstone written to: /data/tombstones/tombstone_05

Focus is not working well for Amazon Fire Phone

Hi guys,

first of all thanks for the great lib. Did you guys have time to play with it on Fire Phone? One thing is really strange, about 80% of the times I start the card.io reader the focus is on far objects instead of being on the card I'm trying to read. And then since the card is blurred the reader doesn't work.

I don't know much about photography but some things could be done with Android's camera intent like setting auto-focus or setting the focus to macro. Are you guys doing it? Maybe on a new version it would be good to have the same tap-to-focus behavior as stock Camera app have.

I'm glad to provide more info if needed.

Thanks,

Sample Android App shows black in scan area testing on Samsung Galaxy Tab S3

I downloaded and ran the sample app through Eclipse on my Samsung Galaxy Tab S3. When I click the button to scan the card, I see the camera except for it is black in the scan area. I line up the card in the rectangle anyway, and it looks like it scans, but doesn't do anything. Any suggestions? Thanks.

Can't find license

Please include LICENSE which covers inclusion of .jar and .so into a final product

Set what camera to use

I don't see a way to set what camera is used to do the scanning. For instance, some devices only have a front camera.

Application Crash after strating the Activity io.card.payment.CardIOActivity;

These steps are followed by me..

  1. classes.jar from cardio-4.0.0.aar
  2. rename "classes.jar" to "card.io.jar", and copy jar into libs
  3. Calling it from MainActivity's button click :-
    Intent scanIntent = new Intent(this, CardIOActivity.class);
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: true
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false); // default: false
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false);
    scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, false); 
    scanIntent.putExtra(CardIOActivity.EXTRA_KEEP_APPLICATION_THEME, true);
startActivityForResult(scanIntent, 100);

error page

error1

CardIO as a View or Subclassable CardIOActivity

We are working on integrating card.io into our product on both Android and iOS. Part of the requirements were to have a landscape-locked orientation when in capture mode. Also, we're to add some UI features. Specifically, a HUD that is consistent with the other features of our software.

Because of the "card.io as a View" option in the iOS SDK, this has been a relatively simple process. On Android, however, it seems that a final Activity is the only option. This makes dealing with custom UI features much more difficult as the Activity cannot be extended.

Change default scan screen

Hi guys,

Is possible to change the default scanning screen, like the tile bar, and add some custom buttom for manual input?

Regards

CardIOActivity.canReadCardWithCamera(this) returns false

Hi there,

I'm using Card.io library on Android 4.3 device, and I keep getting false from CardIOActivity.canReadCardWithCamera(this) in onResume().

My manifest file, layout and java code is exactly same as the sample project (sample project runs fine), and I can't find why it returns false.

Is there any way I can debug? Can you give me any comment?
Thanks!

Support 64-bit processors

The sdk cannot scan card on a Nexus 9. Could you please add support for 64bit processors and other architectures.

Localization and customization

In iOS version there is ability to use localization and to change logo:

@Property(nonatomic, copy, readwrite) NSString *languageOrLocale;

/// Set to YES to show the card.io logo over the camera instead of the PayPal logo. Defaults to NO.
@Property(nonatomic, assign, readwrite) BOOL useCardIOLogo;

Could you, please, add such features to android version?

Security Evaluation Questions - card.io-Android-SDK

Hi card.io Engineers,

Can you please help answer the following security evaluation questions on card.io?

  1. Does card.io adhere to secure coding practices and conduct vulnerability assessments on its SDKs?
  2. Does card.io conduct penetration testing exercises on its SDKs?
  3. What security assurance does card.io provide to enterprise consumers of the card.io SDKs?
  4. If there is a security flaw/critical fix identified in the current or future versions of the card.io SDK, what communication mechanism does card.io team adopt to help consumers of card.io to stay updated with such fixes/patches?
  5. Does card.io have dynamic integrity check mechanism (like a checksum) to ensure card.io SDK integrity at runtime?
  6. Does the card.io app token have an expiry time to it?
  7. How often does the card.io app token get validated?
  8. Can the card scan operation performed without a network connection from a mobile device?
  9. How does the card.io app token get validated when the mobile device does not have a network connection?

Thank you!

Version 3.0.2 [White Label] Image Quality Issue

Hi Card.IO team

My company currently is using Android-SDK 3.0.2 White Label Version.
Even when we use 100% JPEG compression and full resolution, the image quality is still not ideal.
The text on card appears looks somewhat blurry.

I double checked the extra params I can pass to the scanning activity
screen shot 2015-03-05 at 11 24 37 am

None of them mentioned the image quality, I wanna know if there is a way of tweaking that? Thanks!

The following are the full resolution image I captured.
970 x 612 - b

970 x 612 - f

Thanks advance for your help! Any resource will be helpful e.g. documentation and etc.

Card.io view opaque on Samsung S5

We are using card.io library for one of our products and recently we have noticed a strange behavior on all of the samsung devices using that product.

We have integrated card.io (version 3.1.5) in our Android application and when an intent is sent to invoke card.io activity, it opens up the camera view with card.io view totally opaque and I do not see anything in the view. This behavior is only seen on Samsung devices and not on other OEM devices. I see a grey colored rectangle instead of the card.io view and native camera view around this rectangle.

Surprisingly, sample card.io application also behaves the same view.

We installed LevelUp application, but card.io view works perfectly fine on same S5 device.

Could you please look into this issue and provide details on how to fix this issue?

The whole text on ""expiration date" field on DataEntryActivity could not be removed.

Hello, guys! Unfortunately I don't know which version I use because I have only card.io.jar I scanned card successful. Then I wrote date in "expiration date" EditText. Then if I want change date in that field I can delete all chars except first. Try it several times and you will reproduce this. When I wrote second time I could delete chars except first two.

[screen shot redacted]

Chase sapphire preferred card doesn't work.

For this particular card the numbers are on the back of the card. And for some reason, it doesn't seem to be able to capture it. To make sure that was the case, I pulled out my debit card, and it worked.

Documentation issue.

Please in the instructions, bear in mind that gradle's users with
plugin 'com.android.tools.build:gradle:0.7.2+' they only have to put native libraries in
src/main/jniLibs.

Hope this helps someone else!!

Keep up the good work!

EXTRA_GUIDE_COLOR

No Matter what INT is set when passing EXTRA_GUIDE_COLOR, I get no rectangle.

For example:
scanIntent.putExtra(CardIOActivity.EXTRA_GUIDE_COLOR, 0xFF00FF);

Just gives me no rectangle.

Does this version support pure image capture & Paypal logo hiding

Hi card.io team

I used to use the "white label" version for SDK 3.0.2. That version has pure image capture (I believe this for non-payment card without card number) and the Paypal logo can be hidden.

I tried the sample app included in the latest SDK, didn't found those 2 features. I wanna ask does this version has those features?

Thanks!

card.io is not capture the card

use card.io sample code at my app, but scanning does not capture the card, only focused on it. Fully green frame and blured backscreen, but not any action and OnActivityResult does not get any data. What can help? Use Asus TF300t. I use 4.0.0 aar, and I does not provide jniLibs (they must be at .aar, I suppose).

Android card-io could not trigger auto focus

I have used card.io-Android -SDk in my application
when i run the app i am not able to focus
Error: could not trigger auto focus: java.lang.RuntimeException: autoFocus failed.

Crash on CardScanner.nLogManualRefocus v-3.1.3

The card.io Activity crashes upon start on my test device: Galaxy S2, ICS 4.3.1

D/dalvikvm﹕ Trying to load lib /data/app-lib/fr.chauffeurprive.debug-1/libcardioDecider.so 0x41befc58
D/dalvikvm﹕ Added shared lib /data/app-lib/fr.chauffeurprive.debug-1/libcardioDecider.so 0x41befc58
D/dalvikvm﹕ Trying to load lib /data/app-lib/fr.chauffeurprive.debug-1/libopencv_core.so 0x41befc58
D/dalvikvm﹕ Added shared lib /data/app-lib/fr.chauffeurprive.debug-1/libopencv_core.so 0x41befc58
D/dalvikvm﹕ No JNI_OnLoad found in /data/app-lib/fr.chauffeurprive.debug-1/libopencv_core.so 0x41befc58, skipping init
D/dalvikvm﹕ Trying to load lib /data/app-lib/fr.chauffeurprive.debug-1/libopencv_imgproc.so 0x41befc58
D/dalvikvm﹕ Added shared lib /data/app-lib/fr.chauffeurprive.debug-1/libopencv_imgproc.so 0x41befc58
D/dalvikvm﹕ No JNI_OnLoad found in /data/app-lib/fr.chauffeurprive.debug-1/libopencv_imgproc.so 0x41befc58, skipping init
D/dalvikvm﹕ Trying to load lib /data/app-lib/fr.chauffeurprive.debug-1/libcardioRecognizer.so 0x41befc58
D/dalvikvm﹕ Added shared lib /data/app-lib/fr.chauffeurprive.debug-1/libcardioRecognizer.so 0x41befc58
I/Choreographer﹕ Skipped 59 frames!  The application may be doing too much work on its main thread.
W/CardScanner﹕ could not trigger auto focus: java.lang.RuntimeException: autoFocus failed
W/dalvikvm﹕ No implementation found for native Lio/card/payment/CardScanner;.nLogManualRefocus:()V
D/AndroidRuntime﹕ Shutting down VM
W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41984700)
E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.UnsatisfiedLinkError: Native method not found: io.card.payment.CardScanner.nLogManualRefocus:()V
            at io.card.payment.CardScanner.nLogManualRefocus(Native Method)
            at io.card.payment.CardScanner.f(Unknown Source)
            at io.card.payment.CardScanner.onPreviewFrame(Unknown Source)
            at android.hardware.Camera$EventHandler.handleMessage(Camera.java:814)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5289)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
            at dalvik.system.NativeStart.main(Native Method)

Card.io is now allowing invalid Postal Codes

We observed a regression in the Card.io behavior after we integrated BrainTree, from when we depended directly on Card.io. The new behavior is that the Postal Code field allows completely invalid data to be input and the user can complete the Activity with that invalid data. The previous behavior was that invalid Postal Code fields would cause the submit button to be disabled. Ideally, our app would either get a canceled card scan or valid card format from the Card.io Activity, and that's what we used to get.

Gradle support

Is it possible to provide the library in Maven Central so it can be used with Android Gradle?

Hide Flash Button

I'm using card.io on an android tablet (Nexus 7 2013) and it does not have a camera flash. However, there is a flash button displayed on the camera view. Is there a way to hide it?

Unexpected IllegalArgumentException in CardIOActivity.onCreate

In some rare cases the CardIOActivity unexpectedly throws exception IllegalArgumentException due to invalid token.
The token is valid and it's provided with intent.

Caused by: java.lang.IllegalArgumentException: A valid card.io app token must be supplied as a stringExtra with the key CardIOActivity.EXTRA_APP_TOKEN. Get one at https://card.io
at io.card.payment.CardIOActivity.onCreate()

onActivityResult not being called in callback

Running on Samsung S3
Android version 4.1.2


    private void launchCardIOScanner(String cardIOAppToken) {
        Intent scanIntent = new Intent(this, CardIOActivity.class);

        // required for authentication with card.io
        scanIntent.putExtra(CardIOActivity.EXTRA_APP_TOKEN, cardIOAppToken);

        // customize these values to suit your needs.
        scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: true
        scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, true); // default: false
//        scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true); // default: false

        // MY_SCAN_REQUEST_CODE is arbitrary and is only used within this activity.
        startActivityForResult(scanIntent, MY_SCAN_REQUEST_CODE);
    }

// Never called after clicking Done button on CardIOActivity
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
        
       
        if (requestCode == MY_SCAN_REQUEST_CODE) {
 Toast.makeText(this, "get request code " + requestCode, Toast.LENGTH_SHORT).show();
}
}

Icon cannot be removed

Currently, the extra EXTRA_USE_CARDIO_LOGO allows to switch between the Paypal and card.io logos, but there is no way to completely remove the logos.

Our client (a bank) thinks that other logos would "confuse" their clients regarding the usage of such sensitive data as credit card details. The kind of questions they are trying to avoid is:

  • "Paypal? Am I going to do my payments via Paypal? Why do I need to enter this data again? I already have my credit cards in Paypal..."
  • "card.io? what's this? to whom am I sending my credit card numbers?"

Of course, credit should be given where credit is due, but maybe in other ways ("About..." screen, etc.) than placing the logos on the capture screen.

Expiration date not recognized

It seems like the expiration date is never grabbed from the image, only the number. It always falls back to manual entry of the expiration date. Is that expected?
I'm using PayPal SDK 2.7.0 and using this configuration:

    Intent scanIntent = new Intent(activity, CardIOActivity.class);
    scanIntent.putExtra(CardIOActivity.EXTRA_APP_TOKEN, MY_TOKEN);
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true);
    scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true);

Camera not opening

When I tried the same code in Eclipse Project it does not open Camera in real and virtual device both, it is giving a CardDetail activity.How can i resolve this?
capture

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.