question

jolly avatar image
jolly asked Raymond Lee Deactivated edited

Get Credit card detail before order payment make in clover pos

Hello,

Is there a way to trigger the card/chip reader on a Clover device and process the credit card information (CC number, CVV, and expiration date) without going through Payment? Our app needs to use the device for reading credit card information. and based on card detail and after add some service tax based on card, so based on requirement want card detail last 4 digit CC number before payment make. we don't want full CC digits number we want only last 4 digit CC number
OrdersPayments
10 |2000

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

Raymond Lee avatar image
Raymond Lee Deactivated answered Raymond Lee Deactivated edited
Yes you can, you just need to call the ACTION_SECURE_CARD_DATA intent to request for card data. Note that you can specify a message so that you can show what the card entry is for.

It returns a PaymentRequestCardDetails object, which contains the last4 that you can retrieve using the getLast4() method.

Here is some sample code:
Intent cardDataIntent = new Intent(Intents.ACTION_SECURE_CARD_DATA);
cardDataIntent.putExtra(Intents.EXTRA_TRANSACTION_TYPE, Intents.TRANSACTION_TYPE_CARD_DATA);
cardDataIntent.putExtra(Intents.EXTRA_CARD_DATA_MESSAGE, "Please check card");

startActivityForResult(cardDataIntent, CARD_DATA_CODE);
...
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CARD_DATA_CODE) {
        if (data.hasExtra(Intents.EXTRA_CARD_DATA)) {
            PaymentRequestCardDetails cardData = data.getParcelableExtra(Intents.EXTRA_CARD_DATA);

            if (cardData != null && cardData.hasLast4()) {
                Toast.makeText(MainActivity.this, "Last4:" + cardData.getLast4(), Toast.LENGTH_LONG).show();
            }
        }
    }
}
10 |2000

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

Bryanne Vega avatar image
Bryanne Vega answered
Hello,


You can't take the credit card details before taking the payment, you would need to ask for it. You can't read data from the chip/magstripe readers. Your only take is to execute your code/request *after* the payment has been completed & use the SDK/API to get the Payment details.


You can then expand the "cardTransaction" (if using API) to get the last 4 of the 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.

Welcome to the
Clover Developer Community