question

bassel avatar image
bassel asked bassel commented

AuthCode, Last4 and CardType data is always null after processing sale

Hi,


I need to get authcode and card data such as last4 and card type right after sale is processed through secure pay, How much time does it take for the sale to be properly populated so it does not give null values. What permission is needed for such data. The functionality is working fine on my sandbox devkit but when uploaded to production it always gives null values.


What is the best way to guarantee retrieval of data right after sale.

Thanks

Clover Android SDKsemi-integrationsClover Flex
10 |2000

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

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered bassel commented

Can you explain in detail what you are doing? How you are making the payment and how you are grabbing the last4.

5 comments
10 |2000

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

bassel avatar image bassel commented ·

Hi David,


This is the code I am using to retrieve the Order and Payment and Card info:


Intent intent = new Intent(Intents.ACTION_SECURE_PAY);

intent.putExtra(Intents.EXTRA_AMOUNT, bFullAmount);

intent.putExtra(Intents.EXTRA_ORDER_ID, bOrderID);

intent.putExtra(Intents.EXTRA_TIP_AMOUNT, bTipAmount);

intent.putExtra(Intents.EXTRA_CARD_ENTRY_METHODS, Const.cardEntryMethodsAllowed);

startActivityForResult(intent, Const.Screens.SECURE_PAY_REQUEST_CODE);


public void onActivityResult(int requestCode, int resultCode, Intent data) {

if (requestCode == Const.Screens.SECURE_PAY_REQUEST_CODE)

{

if (resultCode == RESULT_OK){

RideInfo tmp1 = new RideInfo();

Order clOrder = orderConnector.getOrder(theOrderID);

tmp1.orderId = clOrder.getId();

tmp1.terminalId = clOrder.getDevice().getId();

tmp1.cloverOrderState = clOrder.getState();

tmp1.cloverCreatedTime = clOrder.getCreatedTime();

tmp1.cloverClientCreatedTime = clOrder.getClientCreatedTime();

//Below code is returning null values on production but working fine on sandbox

List<Payment> payList = clOrder.getPayments();

Payment onePay = payList.get(0);

CardTransaction myCard = onePay.getCardTransaction();

CardType myType = myCard.getCardType();

tmp1.authCode = myCard.getAuthCode();

tmp1.cardType = myType.name();

tmp1.last4 = myCard.getLast4();

AVSResult myRes = myCard.getAvsResult();

tmp1.paymentState = myRes.name();

}


}

0 Likes 0 ·
bassel avatar image bassel commented ·

Hi David,

Any update on how to get the requested data.


Briefly, I am using OrderConnector and its subclasses to get payment and card info. those are giving null values on production, working fine on sandbox devkit


Thanks






0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ bassel commented ·

The way you are doing this may not be reliable (due to order sync). But, I am unavailable and can't look at it this week. Have you tried inspecting the intent? I thought we passed back the payment (instead of retrieving it from the order).

0 Likes 0 ·
bassel avatar image bassel David Marginian ♦♦ commented ·

Does payment data such as (card type, card last 4) require customer read permissions?

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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