cancel
Showing results for 
Search instead for 
Did you mean: 

Reporting API First/Last Name missing in many records

Hello,

 

I'm using the Reporting API SDK in Java, and frequently (around 20% of transactions) I'm unable to access the payer's first or last names.

 

Most of them are from ARB, but occasionally one will be a standard one-off payment.

 

As you can see in the snippet I've copied below, I first attempt to get a Customer object from the TransactionDetails object; if that comes back NULL (which it does in most (all?) of these cases), I'm also attempting to use the more-straightforward TransactionDetails.getFirstName() and getLastName() which typically don't return anything, either.

 

If a Customer object exists, I'll first try obtaining a name pair from the billing Address object, and failing that, from the shipping Address object.

 

What's strange is that, if I look up the tranactions on the auth.net site, the names will be displayed in the appropriate fields.  

 

I must be missing something -- what is it?  Thank you!

 

 

 

  // trxDetails is a TransactionDetails object
Customer customer = trxDetails.getCustomer();
if(customer != null){
	customerID = (customer.getId() == null) ? "": customer.getId();
	Address address = customer.getBillTo();
	if(address != null){
		firstName = (address.getFirstName() == null) ? "" : address.getFirstName();
		lastName = (address.getLastName() == null) ? "" : address.getLastName();	
	}
	else{
		address = customer.getShipTo();
		if(address != null){
			firstName = (address.getFirstName() == null) ? "" : address.getFirstName();
			lastName = (address.getLastName() == null) ? "" : address.getLastName();
		}
	}
}			

if(firstName.equals("")){
	firstName = (trxDetails.getFirstName() == null) ? "" : trxDetails.getFirstName();
	lastName = (trxDetails.getLastName() == null) ? "" : trxDetails.getLastName();
}
seanc_cole
Member
1 REPLY 1

In another thread, I found out that this is a bug in the Java SDK itself.

 

http://community.developer.authorize.net/t5/Integration-and-Testing/Java-SDK-TransactionDetails-isFu...

seanc_cole
Member