card-io / card.io-Android-SDK

card.io provides fast, easy credit card scanning in mobile apps
Other
1.99k stars 533 forks source link

Manual or scan card number ? #148

Open gdeff opened 8 years ago

gdeff commented 8 years ago

Hello,

Required Information

For analytics purpose, I need to know whether the user has filled its credit card number by scanning a card or by manually enter the number. I've seen that there is the EXTRA_MANUAL_ENTRY_RESULT constant in CardIOActivity class but this constant is private and seems to not be used. Moreover, I didn't manage to get this information from the resulting intent in my activity's onActivityResult() method:

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

    if (requestCode == REQUEST_CODE_IOCARD_ACTIVITY) {
        if (data != null && data.hasExtra(CardIOActivity.EXTRA_SCAN_RESULT)) {
            io.card.payment.CreditCard creditCard = data.getParcelableExtra(CardIOActivity.EXTRA_SCAN_RESULT);
                ...
            } else {
                ...
            }
        }
    }

Is there any way to know whether the user has scan a real card or simply manually fill it ?

braebot commented 8 years ago

EXTRA_MANUAL_ENTRY_RESULT is what you want, but you're right that it's not public. We'd be willing to accept a pull request if you'd like to make the necessary modifications. Otherwise, no, I don't believe there's another way to get this information.