stripe / stripe-android

Stripe Android SDK
https://stripe.com/docs/mobile/android
MIT License
1.28k stars 645 forks source link

[Question] are sdk users able to know when a camera card scan is successful or failed? #6424

Closed Angelia-Gong closed 1 year ago

Angelia-Gong commented 1 year ago

Are sdk users able to know when a camera card scan is successful or failed? We want to be able to log analytic events on this.

awush-stripe commented 1 year ago

Hi @Angelia-Gong , you should be able to get the result of the scan through the callback. It will return one of completed, canceled, or failed. See the documentation in the readme here https://github.com/stripe/stripe-android/tree/master/stripecardscan

awush-stripe commented 1 year ago

@Angelia-Gong I realize I may have been premature in my response. Are you directly integrating cardscan, or are you using the cardscan functionality in the stripe's PaymentSheet?

Angelia-Gong commented 1 year ago

@awush-stripe I'm using cardscan in CardFormView

avidpant commented 1 year ago

When the user taps on the card number field, the option to scan a credit card shows up on the keyboard. We want to log an analytic event when that gets triggered along with logging an event for when the card scan was successful or it failed.

tillh-stripe commented 1 year ago

Hi there! Can you share a screenshot of where you see the card scanning functionality?

You mention that you’re using CardFormView, which doesn’t support Stripe’s own card scan feature (this one). I assume that what you’re seeing is the system’s card scan functionality related to credit card autofill.

avidpant commented 1 year ago

Yeah, it does look like this feature isn't coming from CartFormView and is being handled by the OS instead.

tillh-stripe commented 1 year ago

Yes, that’s not Stripe’s card scan functionality. I’m not sure how you’d be able to get the information you’re looking for.

I’ll close this issue here, as there’s nothing we can help you with.