Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Setting collectExpiry to NO not respected when scanExpiry set to YES #96

Closed
wattson12 opened this issue Mar 12, 2015 · 8 comments
Closed
Labels

Comments

@wattson12
Copy link

The functionality I would like to have is the scanner should attempt to scan expiry date, but if it fails the fallback should not be card.io collection (since we have our own form for this with extra validation)

Steps to reproduce:
Using the sample app, add the following lines after initialising the scanViewController:

scanViewController.scanExpiry = YES;
scanViewController.collectExpiry = NO;
scanViewController.collectCVV = NO;

Then scan a card while covering the expiry date and leaving the number visible.

Expected results:
The user should not be prompted to enter an expiry, instead the user should be able to immediately select Done with no prompt to enter an expiry date.

Actual results:
The correct card number is shown, with expiry field shown (as first responder). Done button is disabled until an expiry date is entered

@dgoldman-pdx
Copy link
Member

@wattson12 here's the current logic in card.io:

  • If collectExpiry is NO, then do not attempt to get the expiry, either by scanning or by typing.
  • If collectExpiry is YES, then
    • if scanExpiry is NO, collect the expiry in the Manual Entry screen;
    • if scanExpiry is YES, then
      • try to scan the expiry;
      • if expiry-scan was successful, then pre-fill the Manual Entry screen's expiry field;
      • regardless of expiry-scan success, present the Manual Entry screen to collect/confirm the expiry.

When in the Sample App I set the scanViewController properties as you've described, I can't reproduce your results. Instead, the above logic does indeed seem to be followed: the card number is scanned and the Manual Entry screen never appears.

Getting back to your original question, if what you want to accomplish is to have card.io scan the card and then report back to you its card number and expiry results (which have not yet been confirmed by the user), without ever presenting the Manual Entry screen, then there's a straightforward solution: use a CardIOView rather than a CardIOPaymentViewController.

@wattson12
Copy link
Author

OK it looks like my case is an edge case which falls outside the current logic:

  • if scanExpiry is YES, then
    • try to scan the expiry;
    • if expiry-scan was successful, then pre-fill the Manual Entry screen's expiry field;
    • if scan failed AND collectExpiry = NO then don't show expiry entry, otherwise show entry

I will look into using the CardIOView directly though, thanks for the advice and quick response

@dgoldman-pdx
Copy link
Member

@wattson12 let us know if you run into any problems with the CardIOView.

@maclacerda
Copy link

Hello,

Scan Expiry is possible using only CardIOView ?

Thanks

@dgoldman-pdx
Copy link
Member

@marcoslacerda you can set scanExpiry = YES (which is its default setting) for either a CardIOView or a CardIOPaymentViewController. It works the same in both cases.

@maclacerda
Copy link

Yes, @dgoldman-ebay

But, always return 00/00

Other question, cardHolderName works only using CardIOPaymentViewController?

Thanks

@dgoldman-pdx
Copy link
Member

@marcoslacerda Unfortunately, CardIO succeeds at expiry scans far less often than it succeeds at card-number scans. But this is the same for either CardIOView or CardIOPaymentViewController. The only difference is that the latter then provides a way for the user to enter the expiry manually.

Re cardHolderName you are correct. This is purely a manual-entry field. CardIO cannot scan the cardholder name.

@maclacerda
Copy link

Debtor for its attention @dgoldman-ebay

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants