Reply
Member
Posts: 6
Registered: ‎03-28-2013

Reporting API First/Last Name missing in many records

[ Edited ]

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();
}
Member
Posts: 6
Registered: ‎03-28-2013

Re: Reporting API First/Last Name missing in many records

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...