question

ramya avatar image
ramya asked Jacob Abrams commented

How to Capture Credit Card Info when swiping In SandBox

In our app we need to get creditcard info whenever swiping done

I used this code
// To read card swipe event

In Broadcast receiver
public class CloverBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intents.ACTION_SECURE_CARD_DATA)) {
Toast.makeText(context, "Received Intent "+action, Toast.LENGTH_LONG).show();
} }}

In Manifest
<receiver android:name="munchem.KioskEm.CloverBroadcastReceiver" >
<intent-filter>
<action android:name="clover.intent.action.START_SECURE_CARD_DATA"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</receiver>

// To read Credit card data

In Activity
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);


@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);
} } }


But we are unable to receive intent whenever card swiped
Is there any permissions we have to add?
Can we use any cards for swiping in Sandbox or have to use test creditcard i.e shipped from clover Sandbox device?
Can you please help, How to get Creditcard data when swiped.
Sandbox
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 ·

Please explain what you will do with the swiped card info. Will this creditcard info be used for a payment? Credit card information is sensitive information and is encrypted, it can only be decrypted and processed by our gateway so it will likely not be of much use to you directly.

If you want to build an app for handling gift cards there is a specific process for that which is different from processing creditcards.

If you are building an application that handles swipes of non-payment/non-gift cards that may also be possible and requires another specific process.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community