Hi,
My goal is to get last 4 digits of Credit Card (Account Number) using SDK with transaction id in hand. In sandbox, I got correct account number for all unsettled transactions. However, when I use the following code by giving a particular transaction Id, I am getting all the details of transaction except null for account number. Please let me know if I am missing anything.
net.authorize.reporting.Transaction authCaptureTransaction = merchant.createReportingTransaction(net.authorize.reporting.TransactionType.GET_TRANSACTION_DETAILS);
net.authorize.data.xml.reporting.ReportingDetails reportingDetails = net.authorize.data.xml.reporting.ReportingDetails.createReportingDetails();
reportingDetails.setTransactionId("2226945195");
authCaptureTransaction.setReportingDetails(reportingDetails);
net.authorize.reporting.Result<net.authorize.reporting.Transaction> result = (net.authorize.reporting.Result<net.authorize.reporting.Transaction>)merchant.postTransaction(authCaptureTransaction);
ArrayList<net.authorize.data.xml.reporting.TransactionDetails> transactionDetails = result.getReportingDetails().getTransactionDetailList();
for(int i=0; i<transactionDetails.size(); i++) {
System.out.println("transaction id:" + transactionDetails.get(i).getTransId() +
" account number:" + transactionDetails.get(i).getAccountNumber() );
}
โ01-22-2015 05:41 PM
have you check the raw response? it the whole result is null? did you turn on the detail transaction api on the merchant account?
โ01-23-2015 04:33 AM
Actually, I have mistaken Account Number to be credit card number. My intention is to get last 4 digits of Credit Card. I got this information from the following way
transactionDetails.get(i).getPayment().getCreditCard().getCreditCardNumber()
โ01-23-2015 08:16 AM