question

steve-egan avatar image
steve-egan asked Jacob Abrams edited

Possible to use NFC or magstripe with non-payment cards?

Is it possible for an app to use the magstripe reader or NFC for non-payment cards such as a loyalty card or is it limited to using the barcode scanner? I understand that I can capture track information by starting the Clover secure payment app and get a result in the PaymentRequestCardDetails object but I'm just wondering if the magstripe reader or NFC can be used for non-payment cards?

Thanks, Steve

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jacob Abrams avatar image
Jacob Abrams answered Jacob Abrams edited
As of 2018 it is now possible to use NFC for non-payment related functionality. Please see: https://docs.clover.com/clover-platform/docs/building-with-android-nfc

If you want to use the mag stripe reader for non-payments it is possible, however you need to have a specific card number range added to the bin whitelist which is a list of ranges which are not immediately encrypted but instead returned to applications unencrypted.
The below code works on Clover Mobile & Mini
<code>Intent magStripeRequest = new Intent(Intents.ACTION_SECURE_CARD_DATA) .putExtra(Intents.EXTRA_CARD_ENTRY_METHODS, Intents.CARD_ENTRY_METHOD_MAG_STRIPE) .putExtra(Intents.EXTRA_TRANSACTION_TYPE, Intents.TRANSACTION_TYPE_CARD_DATA) .putExtra(Intents.EXTRA_CARD_DATA_MESSAGE, "Howdy"); startActivityForResult(magStripeRequest, 123); // Result will be in a bundle extra Intents.EXTRA_CARD_DATA, type is com.clover.sdk.v3.pay.PaymentRequestCardDetails // which contains the track1, track2 and track3 data.

On Clover Station an intent is broadcast any time the card is swiped. There is no need to start an activity to request the swipe. It is com.clover.carddata.ACTION_CARD_DATA_READ which contains the String extras "track1", "track2" and "track3". It will contain the full unencrypted data only if the card number is in the whitelist.
The object returned is called PaymentRequestCardDetails but need not be used for a payment. To get card number ranges whitelisted please send a message to dev@clover.com. We may also have some existing ranges whitelisted that you can test with which we can share with you if you have a mag stripe writer.

6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

steve-egan avatar image steve-egan commented ·

Thanks for taking the time to answer my question.

0 Likes 0 ·
chris-mick avatar image chris-mick commented ·

Jacob, Is there any plan to add support for non-payment NFC functionality? It is essential for a project that I'm interested in.

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

There is no plan at this time.

0 Likes 0 ·
Al Connelly avatar image Al Connelly commented ·

I am also interested in non-bank card NFC functionality.

0 Likes 0 ·
viraj avatar image viraj commented ·

@Jacob Abrams Any update if the Clover Flex can accept non-payment magnetic stripe cards using the magnetic stripe reader? Also, any support for non-payment NFC cards like MiFare Classic, MiFare DESFire, etc?

CC : @Sam @rachel

Thanks in advance!

0 Likes 0 ·
sam avatar image sam viraj commented ·

Hey @Viraj

You can read card data using our ACTION_SECURE_CARD_DATA activity.

NOTE: Please be aware if your BIN number is not whitelisted, the raw track data will be masked to protect sensitive data.

An example code:

public void readCard(View view) {
                    
final Intent intent = new Intent(Intents.ACTION_SECURE_CARD_DATA);
intent.putExtra(Intents.EXTRA_TRANSACTION_TYPE, Intents.TRANSACTION_TYPE_CARD_DATA);
startActivityForResult(intent, CARD_DATA_REQUEST_CODE);
}

and inside onActivityResult:

if (requestCode == CARD_DATA_REQUEST_CODE) {
                    
// Make sure the request was successfulif (resultCode == RESULT_OK) {
// The user picked a contact.

Unfortunately, NFC for 3rd party use is not yet available on Flex.

0 Likes 0 ·

Welcome to the
Clover Developer Community