Card Query (Optional)

What is a card query?

A card query simply means that a call will be done to an acquirer to obtain specific information about the card.

The process to obtain this specific card data is done by swiping the card on the payment device. The card data that is returned is commonly referred to as the Track2 data.

👍

Track 2 data:

Track 2 data is encoded in a numerical format and primarily contains essential information necessary for processing credit card transaction. This data is also stored on the magnetic stripe of the card.

The Track2 data consists of the below information:

  • cardholder's card number and,
  • expiry date

The below code sample must be used to invoke the card query on the Payment App.

private String appURL = "payment.thumbzup.com";
private String appClass = "payment.thumbzup.com.IntentActivity";
Intent intent = new Intent();
intent.setClassName(appURL, appClass);
Bundle dataBundle = new Bundle();
dataBundle.putString("launchType", "CARDQUERY");
dataBundle.putString("applicationKey", "2fdca02f-3cbe-4e8c-82ad-86a1a16b72e7");
dataBundle.putString("merchantID", "910100000000001");
dataBundle.putString("merchantUsername", "default");
dataBundle.putString("authenticationKey", "c282cdd3-59d2-42ff-8c96-826725a27e6e");
intent.putExtra("thumbzupBundle", dataBundle);
startActivityForResult(intent, 0);

Now we will take a look at the response you will receive.

📘

It is important to note:

There are 2 different responses that may be received when performing this function and are solely dependent on the Merchants configuration settings.

These responses are detailed as per below:

  • Response if the Merchant is not whitelisted
  • Response if the Merchant is whitelisted

When the response is returned the calling app needs to override the onActivityResult() method and can be done as follows:

@Overide
protected void onActivityResult(int requestCode, int resCode, Intent data) {
String result = "";
Bundle b = new Bundle(data.getBundleExtra("ThumbzupApplicationResponse")); 
if(resCode == Activity.RESULT_OK) {
// handle ok result
String launchType = b.getString("launchType");
String resultCode = b.getString("resultCode"); 
String track1Data = b.getString("track1Data"); 
String track2Data = b.getString("track2Data"); 
String panData = b.getString("panData");


The below code samples are examples of a response you may receive due to the cards whitelisting status.

👍

What is Whitelisting or a whitelist?

A whitelist is a positive list created according to certain criteria (country of origin of the credit card or IP address). If you want to allow credit card payments only from a defined list of countries, you can have the corresponding countries added on the whitelist.


The following code sample is a response you will receive when a card is not whitelisted.

fwUpdateDate=null
buildInfo=THUMBZUP_INT applicationKey=6397dead-7d4b-47f7-a0a5-71e5d1705fc4 
fwUpdateVersion=null
pebbleFirmwareVersion=v3.1.4
fwUpdateAvailable=false
overrideMerchantNumber=null merchantID=910300000000015 merchantUsername=default
pebbleSerialNumber=
B26700220006EF9FFF0608D751 thirdPartyUsername=null
isApproved=null
launchType=CARDQUERY
keepAliveAfterExit=0
merchantName=Mehroze Dev deviceIMEI=353266080214059
appVersion=3.21.230

The following code sample is a response you will receive when a card is not whitelisted.

fwUpdateDate=null
buildInfo=THUMBZUP_INT applicationKey=6397dead-7d4b-47f7-a0a5-71e5d1705fc4
fwUpdateVersion=null
pebbleFirmwareVersion=v3.1.4
fwUpdateAvailable=false
overrideMerchantNumber=null
merchantID=910300000000015
merchantUsername=default
pebbleSerialNumber= B26700220006EF9FFF0608D751
thirdPartyUsername=null
isApproved=
launchType=CARDQUERY
keepAliveAfterExit=0
merchantName=Mehroze Dev
deviceIMEI=353266080214059
appVersion=3.21.230