Reply
Highlighted
Contributor
Posts: 23
Registered: ‎01-09-2015

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

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

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

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

Highlighted
Contributor
Posts: 23
Registered: ‎01-09-2015

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

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