question

janaka avatar image
janaka asked Mark Mullan Deactivated commented

Android ACTION_SECURE_PAY: Response

I'm developing an app with Clover MINI android device and using ACTION_SECURE_PAY to take payments. Currently testing in SANDBOX environment with Fist Data - Test Card 01.

Following is a sample response received after a successful payment. In JSON format to see response

"cardTransaction":{ "cardholderName":"Card 01 Test", "authCode":"824528", "entryType":"EMV_CONTACT", "token":"", "extra":{ "applicationIdentifier":"A0000000031010", "cvmResult":"SIGNATURE", "routingIndicator":"C" }, "state":"PENDING", "referenceId":"85385421", "last4":"0010", "transactionNo":null, "type":"PREAUTH", "cardType":"VISA", "vaultedCard":null },

In onActivityResult I read data as follows

if (resultCode == RESULT_OK)
{
    Payment payment = data.getParcelableExtra(Intents.EXTRA_PAYMENT);
    // Read payment data
    if (payment != null)
    {
        Log.v("x", payment.getJSONObject().toString());

        Long amount = payment.getAmount();
        String paymentID = payment.getId();

        CardTransaction cardTrx = payment.getCardTransaction();
        -------->>>> continue
    }
}
else
{
    Toast.makeText(this,"Payment Not Successful.", Toast.LENGTH_LONG).show();
}

QUESTIONS

1). First I need to get the Payment Status (Authorised, Declined or Failed)... How can I get this from above data ?

2). I see State as PENDING. Can you please explain what that is ? This is an Authorised payment.

3). I need to simulate Declined and Failed transactions (in SANDBOX environment) and how can I do this ?

4). I need to grab the first 6 of the card number but it is null.

5). If possible would like to read Card Token as well. In above response you can see it is empty.

Thanks.

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.

Mark Mullan avatar image Mark Mullan commented ·

Hi @Janaka,

Will you please email us your sandbox Merchant ID at dev@clover.com and reference this thread? We'll need to ensure that your merchant supports multi-pay, which is what causes us to return vaultedCard objects that have properties like first6 and token, among others.

Thanks,

Mark

0 Likes 0 ·

1 Answer

sam avatar image
sam Deactivated answered

1). First I need to get the Payment Status (Authorised, Declined or Failed)... How can I get this from above data ?

You will get this from Result = SUCCESS, DECLINED, FAILED

2). I see State as PENDING. Can you please explain what that is ? This is an Authorised payment.

PENDING means transaction hasn't been closed out. Once the payment has been closed, it will return state = CLOSED.

3). I need to simulate Declined and Failed transactions (in SANDBOX environment) and how can I do this ?

You will need to be pointed to CERT gateway. Please email your merchant id to dev@clover.com

4). I need to grab the first 6 of the card number but it is null.

This param is not returned by this activity. The first six can be found using Intents.ACTION_SECURE_CARD_DATA, which is available on Mini and Mobile.

5). If possible would like to read Card Token as well. In above response you can see it is empty.

Multipay card token is not supported at the moment.

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