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.