stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

Adding card using NFC and/or card.io

Open ahaverty opened this issue 7 years ago • 28 comments

Hi Stripe, feature request/discussion: A lot of Android's have the ability to read cards with NFC/contactless with a library like this https://github.com/pro100svitlo/Credit-Card-NFC-Reader

We're thinking of integrating that library + use stripe's programmatical .set's Is this something that could be added to Stripe's library? I haven't seen any apps other than demo apps using contactless, does anyone have any thoughts on security/UX?

We'd also like to give the option to use the camera to add. Something like card.io, but the android library seems to be in a poor state. Is that something Stripe could ever work on?

ahaverty avatar Dec 04 '17 11:12 ahaverty

Hi @ahaverty! Thanks for writing in with the suggestions :)

I want to make sure I understand the suggestions/questions:

  • Are you asking if we can add NFC/contactless in the Stripe SDK or are you asking if we have opinions on the security UX of it?
  • Are you asking for us to add card.io into the Android library? Were you imaging this would be part of the end to end solution using PaymentsSession or as a standalone widget?
  • We're always looking to understand how the SDK can be improved. You mentioned the library is in a poor state, would love more details around that (haha don't worry about offending me, extra info is always helpful!!)

ksun-stripe avatar Dec 04 '17 17:12 ksun-stripe

Hi @ksun-stripe I'm wondering if stripe can add either/both. I'd also like to hear if Stripe have any thoughts on the UX/security of either libraries/methods in the meantime.

This stripe library seems to be in great shape! I meant that the card.io android library has been in ruin for the last year.

iOS cardio is usable, surely android could have some great image/NFC libraries. I'm wondering why either aren't popular, maybe it's something I haven't thought of? Thanks for the help 👌

ahaverty avatar Dec 05 '17 07:12 ahaverty

@ahaverty - I can't speak to everything here, but EMV (of which NFC is ~classified; thanks to ISO/IEC 14443) is a murky area. EMV (theoretically) requires hardware certification on a per device, per partner, per territory, and per card brand basis, as far as I know. Meaning, adding support for this is arguably a violation of the card network's terms. It's murky though, because it's tough to say if that's really true for cell phones.

From an Engineering perspective though, I love the idea of using NFC for this. So simple! I'm gonna ask around and see if anyone else has thoughts on this.

anelder-stripe avatar Dec 11 '17 21:12 anelder-stripe

Moving this to our internal task tracking system so we can get it prioritized. :) https://jira.corp.stripe.com/browse/ANDROID-196 (internal only link for tracking purposes)

ksun-stripe avatar Jan 29 '18 19:01 ksun-stripe

@ksun-stripe Any status update on this issue please? Card.io support would be greatly appreciated!

jkscheung avatar May 04 '18 03:05 jkscheung

Hi @ksun-stripe, any update on that internal ticket? Revolut.com have it in their android app 🤔 screenshot_20181024-163240

ahaverty avatar Oct 24 '18 15:10 ahaverty

Any update on this?

evanjmg avatar Mar 26 '19 09:03 evanjmg

@ksun-stripe @anelder-stripe hey! Any updates on this?

IrinaBulygina avatar Aug 02 '19 15:08 IrinaBulygina

@IrinaBulygina thanks for resurfacing this issue. We're starting to investigate a card scan solution for our Android SDK. I'll share further updates here.

mshafrir-stripe avatar Aug 02 '19 15:08 mshafrir-stripe

Very interested bro see what happened here. I have seen lots about the NFC payment method but yet to see it's possible

jamiejackherer avatar Mar 15 '20 10:03 jamiejackherer

May I know the status of Card scan functionality? When It will be available for use?

ChiragSavsani avatar Apr 06 '20 05:04 ChiragSavsani

@ChiragSavsani I don't have any updates to share at this time, but you can follow this issue to be notified of any future updates.

mshafrir-stripe avatar Apr 06 '20 12:04 mshafrir-stripe

@mshafrir-stripe is there an update on this functionality? One of our clients explicitly wants card scan functionality, we chose Stripe as we know it is supported on the iOS version by default with the Stripe prebuilt components.

If there are no plans to add this functionality then would it be possible to do so with a custom implementation without using the pre-built components? I would like to know for certain before I set out to rebuild from the ground up .

I'm not sure of the complexity of building a Stripe integration myself, where would I find good documentation for use of the components such as CardInputWidget? Would using a CardInputWidget allow me to scan the card details and populate the card info from the scan callback? Would implementing these myself require extensive backend changes?

Any advice much appreciated.

thebillington avatar Apr 30 '20 10:04 thebillington

Would be great to know if there is any update on this?

jameslevine avatar Jun 16 '20 09:06 jameslevine

@jameslevine doesn't seem the Stripe team are doing any work on this right now, hopefully there'll be a proper solution soon.

In the meantime I setup my own solution with the help of our web team. For the API when you create an account, send a request to Stripe to create a new customer and then create endpoints for:

All of this can be setup on the Android side as well, but a lot of our payment logic was already on the backend so we decided to make the changes there.

In app all you have to do is create an Activity that allows you to add a new payment method, with a button to start card.io:

mBinding.scanButton.setOnClickListener { 
    startActivityForResult(Intent(this, CardIOActivity::class.java), CARD_IO_SCAN)
}

Then handle the returned card details:

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    if (requestCode == CARD_IO_SCAN) {
        data?.getParcelableExtra<CreditCard>(CardIOActivity.EXTRA_SCAN_RESULT)?.let { creditCard ->
            mBinding.cardNumberTextInputLayout.setText(creditCard.formattedCardNumber)
        }
    }
    super.onActivityResult(requestCode, resultCode, data)
}

Finally a call to your server to create the card:

private fun createPaymentCard(cardNumber: String?) {
    CallToServer.submitCardDetails(cardNumber)?.observe(this, Observer {
        if (it.status == Status.SUCCESS) {
            CoroutineScope(Dispatchers.IO).launch { AppDatabase.database.paymentCardModelDao().setDefaultCard(it.data?.paymentMethodID) }
            finish()
        } else {
            // Handle errors
        }
    })
}

Then I just created another Activity that would fetch all PaymentMethods from the server and display them in app, with the ability to delete/select a PaymentMethod to be used for any payment. When making a payment I just send the PaymentMethodID for the default card, or whichever the user has selected.

Hope that's helpful and gives enough info, the work took a lot less time than I had originally thought it would.

thebillington avatar Jun 16 '20 10:06 thebillington

Any updates on this? Would be awesome if Stripe for Android had the same scanning feature as the iOS version!

DomenicBianchi01 avatar Dec 01 '20 01:12 DomenicBianchi01

I second what @DomenicBianchi01 said 👍

jamesdixon avatar Dec 03 '20 14:12 jamesdixon

Any updates on this?

cmbaykal avatar Dec 08 '20 07:12 cmbaykal

Thanks for your feedback. We don't have any updates to share at this time, but will keep this issue posted if anything changes.

mshafrir-stripe avatar Dec 08 '20 15:12 mshafrir-stripe

Hi, is there any update on card scan in android stripe SDK

bnandhinidevi avatar Apr 19 '21 11:04 bnandhinidevi

Any update ? Ineterrested in as well

aiKrice avatar Jun 03 '21 14:06 aiKrice

Any update ? Ineterrested in as well

eduprat-chwy avatar Sep 08 '21 13:09 eduprat-chwy

Hello! Stripe recently acquired Bouncer, which is a native android and iOS card scanning library (see https://getbouncer.com/scan and https://github.com/getbouncer/cardscan-android). Bouncer is presently working on integrating its card scanning technology into the stripe android and iOS SDK, with an anticipated release date in early 2022.

awush-stripe avatar Sep 08 '21 18:09 awush-stripe

Okay so Stripe just announced the ScanCard feature, but I don't see any doc about it, I saw the repo , need to create a CIV intent , any infos please?

Dave181295 avatar Jan 28 '22 22:01 Dave181295

hi @Dave181295 , Stripe card scanning will release today, and will not require a CIV intent. CIV intent is for a future product.

awush-stripe avatar Feb 14 '22 23:02 awush-stripe

That's fantastic news! When will Stripe's docs be updated? @awush-stripe

Dave181295 avatar Feb 20 '22 22:02 Dave181295

hi @Dave181295 we're working on the docs presently, and we'll likely be making some small API tweaks. Expect an update in the next few weeks.

awush-stripe avatar Mar 03 '22 19:03 awush-stripe

@awush-stripe is there an update on this? are the docs up-to-date?

upside-sarah avatar Aug 16 '22 02:08 upside-sarah

Hello , Any updates on having scan card option for android same like in IOS ?

maulik-vegans avatar Nov 04 '22 11:11 maulik-vegans

Any updates on this?

E-Pebl avatar Dec 07 '22 03:12 E-Pebl