Reading Loyalty and Bonus Cards
In addition to processing transactions with
payment cards such as Visa and Mastercard, the
TransactionProvider
also makes it easy for your device to read
the card number (PAN) from Loyalty or Bonus Cards with magstripes. Currently only
Miura card readers can read Loyalty or Bonus Cards.
In order to ensure the highest security standards and to not read the payment card PAN , the
BIN (i.e., the first six digits) of your loyalty
or bonus card scheme must specifically be
white-listed by us and never overlap with the BINs
used by payment cards.
Contact your account manager to determine if this feature will work with
your specific loyalty or bonus card scheme.
Reading a Loyalty or Bonus Card with a Magstripe
Call
readCard
on your
TransactionProvider
and implement the
ReadCardProcessListener
. After a successful swipe,
CardDetails
will contain the unencrypted
cardNumber
and raw
track1
,
track2
and
track3
data.
transactionProvider.readCard(accessoryParameters, new ReadCardProcessListener() {
@Override
public void onCompleted(CardProcess cardProcess, CardProcessDetails cardProcessDetails) {
if(cardProcessDetails.getState() == CardProcessDetailsState.COMPLETED) {
CardDetails details = cardProcess.getCardDetails();
if(details.getMaskedCardNumber() != null) {
Log.d("mpos", "MaskedCardNumber: " + details.getMaskedCardNumber());
}
if(details.getCardNumber() != null) {
Log.d("mpos", "CardNumber: " + details.getCardNumber());
}
if(details.getTrack1() != null) {
Log.d("mpos", "Track1: " + details.getTrack1());
}
if(details.getTrack2() != null) {
Log.d("mpos", "Track2: " + details.getTrack2());
}
if(details.getTrack3() != null) {
Log.d("mpos", "Track3: " + details.getTrack3());
}
}
}
@Override
public void onStatusChanged(CardProcess cardProcess, CardProcessDetails cardProcessDetails) {
Log.d("mpos", "status changed: " + Arrays.toString(cardProcessDetails.getInformation()));
}
});