card.io-Android-SDK icon indicating copy to clipboard operation
card.io-Android-SDK copied to clipboard

Can't recognize expiry date

Open AlexZvonik opened this issue 8 years ago • 29 comments

Card.IO ver. 5.3.0 can't recognize expire date.

Intent scanIntent = new Intent(this, CardIOActivity.class); scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true); scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); startActivityForResult(scanIntent, CreditCardActivity.SCAN_CARD_REQUEST_CODE)

Both card number and the expire date of the same card can be successfully recognized in the Uber app (which use Card.IO for card recognition).

AlexZvonik avatar Feb 08 '16 14:02 AlexZvonik

Are you testing using the most recent sample app? Have you tried compiling a release version, and/or with proguard? Nothing has changed wrt expiry scanning since the release that Uber is using.

braebot avatar Feb 08 '16 15:02 braebot

I've been testing on the latest sample app (checked it out yesterday from the repo). Also i tried both release and debug with proguard enabled/disabled.

During debugging i found that expiry is empty after calling native code:

/** pika **/
nScanFrame(data, mPreviewWidth, mPreviewHeight, mFrameOrientation, dInfo, detectedBitmap, mScanExpiry);

AlexZvonik avatar Feb 09 '16 07:02 AlexZvonik

It could be that the iOS native code performs better than Android, but I couldn't be sure without some investigation. Have you tried building the source and enabling debugging?

braebot avatar Feb 16 '16 15:02 braebot

I tried to debug sample app and found that native code doesn't return us expiry date. (see my prev. comment). I'm not very familiar with C/C++ thus i can't properly debug native code for sure.

AlexZvonik avatar Feb 17 '16 06:02 AlexZvonik

Looks like expiry scanning is working only when you set the following extras in the below order: scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true);

When I've set these extras in the above order sometimes it was reading the expiry date. Otherwise it was not reading the expiry date at all.

I've also tried the iOS SDK and it performed much better than the Android one, both at expiry scanning and card scanning.

cczank avatar Mar 03 '16 14:03 cczank

The expiry should scan without EXTRA_SCAN_EXPIRY, as the default of that extra is true. Are you saying this is not the case?

As for iOS vs. Android, we haven't done detailed analysis into the differences in platforms, so there's probably some OS-level optimization that could be done.

braebot avatar Mar 03 '16 22:03 braebot

Initially I had only scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); set in the app but it was never reading the expiry date. After adding scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true); it started to read sometimes the expiry date.

I've also noticed that on some devices I am not able at all to read the expiry date. For example on a Samsung Galaxy S4 and Samsung Galaxy S6 it is reading the expiry date, but on a Galaxy Note 5 it's never reading. I've tested this with the same CC that I was able to fully read on S4 and S6, but not on Note 5.

cczank avatar Mar 04 '16 07:03 cczank

@cczank I think the order of extras listed above doesn't make sense because inside of the Card.io library the order of getting extras from intent isn't changing. Also on GS4 5.0.1 i wasn't able to read expiry date.

Might it be dependent on processor on the phone?

AlexZvonik avatar Mar 04 '16 07:03 AlexZvonik

Agreed that it doesn't make sense. The extra's default value is true when reading from the extras. It could be that some versions are reading this incorrectly, and that we should not rely on that mechanism.

braebot avatar Mar 10 '16 18:03 braebot

Hi braebot , I Am using the below code and i am unable to get the expiry date. scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true); scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_RESTRICT_POSTAL_CODE_TO_NUMERIC_ONLY, false); // default: false scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CARDHOLDER_NAME, false); // default: false

    // hides the manual entry button
    // if set, developers should provide their own manual entry mechanism in the app
    scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, false); // default: false

    // matches the theme of your application
    scanIntent.putExtra(CardIOActivity.EXTRA_KEEP_APPLICATION_THEME, false); // default: false

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

I Am using io.card:android-sdk:5.4.0.

SankarAndroid avatar Jun 27 '16 12:06 SankarAndroid

@SankarAndroid, there is most likely a bug with expiry on Android. Several folks have not been able to successfully get it to work for several releases.

braebot avatar Jun 27 '16 21:06 braebot

Thanks for the reply @braebot . May I know when can we expect the next release of card.io so that we can successfully get the expiry date along with card number.

sivasankar-android avatar Jun 27 '16 21:06 sivasankar-android

Can confirm the issue. Used latest version. Devices tested - Samsung S6, Nexus 6, Xiaomi Redmi 3. Even with EXTRA_SCAN_EXPIRY = true can`t get the expiration date. The card itself is black and digits are silver and recognised without any problems on iPhones. Please, investigate this issue.

vbuberen avatar Aug 26 '16 10:08 vbuberen

I also can't read the expiry date. Just can scan card number. I used the 5.4.2 version SDK. I tested it in Galaxy S6, GalaxyNote2, Nexus 5, LG G5.

netcleaner avatar Oct 28 '16 00:10 netcleaner

@braebot, On nexus 5x I also can't scan expiry. But on same device Uber and Beam can scan. Can you please let me know if I am missing something.

Intent scanIntent = new Intent(this, CardIOActivity.class);

    scanIntent.putExtra(CardIOActivity.EXTRA_SUPPRESS_MANUAL_ENTRY, true);
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true);
    scanIntent.putExtra(CardIOActivity.EXTRA_SCAN_EXPIRY, true);

    scanIntent.putExtra(CardIOActivity.EXTRA_HIDE_CARDIO_LOGO, true);
    scanIntent.putExtra(CardIOActivity.EXTRA_USE_PAYPAL_ACTIONBAR_ICON, false);

    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false);
    scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false);
    scanIntent.putExtra(CardIOActivity.EXTRA_RESTRICT_POSTAL_CODE_TO_NUMERIC_ONLY, false);

    startActivityForResult(scanIntent, MY_SCAN_REQUEST_CODE);

ssajjad avatar Nov 09 '16 14:11 ssajjad

Hi @braebot, is there any update about this issue?.

ssajjad avatar Nov 16 '16 08:11 ssajjad

Hi @lkorth, is there any update on this?

ssajjad avatar Nov 28 '16 16:11 ssajjad

Guys, any update on this issue?

dmitry-novikov avatar Feb 08 '17 17:02 dmitry-novikov

buildTypes { debug { minifyEnabled false debuggable true } }

also in manifest file : android:debuggable="true" in application tag. works

vikaskumark avatar May 03 '17 09:05 vikaskumark

does this expiry date issue fix?

nidhinvv avatar Jun 01 '17 08:06 nidhinvv

Any update on this?

mladenrakonjac avatar Jun 07 '17 11:06 mladenrakonjac

👍

ben-j69 avatar Jun 27 '17 09:06 ben-j69

Our best approach to get the expiry date was this one:

  • Exclude 64bit ABIs (x86_64, arm64-v8a). That's why it works on some devices better/worser
  • Take Version 5.4.0

It works about 60-70%, depends on device and/or card

MarcelRitz avatar Jun 29 '17 15:06 MarcelRitz

@MarcelRitz solution worked for us, started to see expiry date recognized. It is not guaranteed though, might have to try a few times, turning on flash can help.

Raenar4k avatar Jul 04 '17 18:07 Raenar4k

confirm issue on Nexus Android 7.1.1 using Cardio:5.5.1 Sample Application. Expiry Month and Years : 0/0 .

issamux avatar Jul 11 '17 13:07 issamux

any update for this issue? Uber app recognize the expiry date sometimes but the current sample app doesn't. My device is Galaxy S8 (Android 7.0)

jisung avatar Oct 09 '17 14:10 jisung

No working for my either, running an Android 6.0.1 (OP2).

facundofarias avatar Dec 29 '17 19:12 facundofarias

Also seeing this issue with version 5.5.1, it's 100% reproducible on all the devices we have here including One Plus 3T, Pixel 2, Samsung Galaxy S7

DonalRafferty avatar Jan 04 '18 10:01 DonalRafferty

Same issue with version 5.5.1 and Samsung Note 5. The expiry date is not recognized.

islamassi avatar Oct 11 '18 12:10 islamassi