How can I capture card track information for non-payment purposes? For example, to capture track information from a loyalty card?
How can I capture card track information for non-payment purposes? For example, to capture track information from a loyalty card?
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);
}
}
}
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/
I am also trying to do this, but CardEntryMethods.MAG_STRIPE is not resolving to anything...
I updated the answer, it should be Intents.CARD_ENTRY_METHOD_MAG_STRIPE
.
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?
2 People are following this question.