question

Jeffrey Blattman avatar image
Jeffrey Blattman asked alvinato commented

How can I capture card track information?

How can I capture card track information for non-payment purposes? For example, to capture track information from a loyalty card?

10 |2000

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

Jeffrey Blattman avatar image
Jeffrey Blattman answered alvinato commented

You can start the Clover Secure Payment app to capture card data and have it returned to your app. Start the Secure Payment activity for result using the ACTION_SECURE_CARD_DATA action.

final Intent intent = new Intent(Intents.ACTION_SECURE_CARD_DATA);
intent.putExtra(Intents.EXTRA_CARD_ENTRY_METHODS, Intents.CARD_ENTRY_METHOD_MAG_STRIPE);
intent.putExtra(Intents.EXTRA_TRANSACTION_TYPE, Intents.TRANSACTION_TYPE_CARD_DATA);
startActivityForResult(intent, REQUEST_PAY);

If the card is swiped and read successfully, you will get an activity result RESULT_OK with the card data as extras.

  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_PAY) {
      if (resultCode == RESULT_OK) {
        PaymentRequestCardDetails details = data.getParcelableExtra(Intents.EXTRA_CARD_DATA);
      }
    }
  }
1 comment
10 |2000

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

alvinato avatar image alvinato commented ·

I've used the code above and can't seem to start the ACTIONSECURECARTDATA. My issues are detailed here: https://devask.clover.com/question/74...securecarddata/

0 Likes 0 ·
caseyd avatar image
caseyd answered Jacob Abrams commented

I am also trying to do this, but CardEntryMethods.MAG_STRIPE is not resolving to anything...

1 comment
10 |2000

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

Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

I updated the answer, it should be Intents.CARD_ENTRY_METHOD_MAG_STRIPE.

0 Likes 0 ·
bill-collins avatar image
bill-collins answered

I also needed to read loyalty card number, but I can not. I get only the first 6 digits and the last 4 digits. How do I get the full card number?

10 |2000

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

Welcome to the
Clover Developer Community