cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Transaction Details API: Returning null Account Number for a particular transaction

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() );            
                           
            }

smartk1977
Contributor
2 REPLIES 2

have you check the raw response? it the whole result is null? did you turn on the detail transaction api on the merchant account?

RaynorC1emen7
Expert

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()