Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 2
Registered: ‎02-14-2014

Java SDK Bugs Report

[ Edited ]

The first is a bug that was already reported a few years ago and it still has not been fixed. Here is the link:

 

http://community.developer.authorize.net/t5/Integration-and-Testing/Java-CIM-SDK-not-returning-bank-...

The second is a bug with BankAccountType. The CIM and ARB APIs expect a value of checking, savings, and businessChecking for the account type for bank account payments. However when the request is being built, the code simply lower cases the enum, therefore all the specific requests involing the the business checking type fail because it evaluates to businesschecking instead of businessChecking. You can see my temporary work around below. I added a second value value2 which holds the right value to be used when making a request.

 

package net.authorize.data.echeck;

import java.io.Serializable;

/**
 * Supported bank account types.
 *
 */
public enum BankAccountType implements Serializable {
	CHECKING("CHECKING","checking"),
	BUSINESSCHECKING("BUSINESSCHECKING","businessChecking"),
	SAVINGS("SAVINGS","savings"),
	UNKNOWN("UNKNOWN","unknown");

	private final String value;
	private final String value2;

	private BankAccountType(String value, String value2) {
		this.value = value;
		this.value2 = value2;
	}

	public static BankAccountType findByValue(String value) {
		for(BankAccountType bankAccountType : values()) {
			if(bankAccountType.value.equals(value) || bankAccountType.value2.equals(value)) {
				return bankAccountType;
			}
		}

		return BankAccountType.UNKNOWN;
	}

	/**
	 * @return the value
	 */
	public String getValue() {
		return value;
	}

	/**
	 * @return the value2
	 */
	public String getValue2() {
		return value2;
	}
}

 On both the arb/Transaction.java and cim/Transaction.java, i updated the following code:

 

if(bank_account.getBankAccountType() != null) {
   Element account_type_el = document.createElement(AuthNetField.ELEMENT_ACCOUNT_TYPE.getFieldName());
account_type_el.appendChild(document.getDocument().createTextNode(bank_account.getBankAccountType().getValue().toLowerCase()));
 				bankacct_el.appendChild(account_type_el);
 }

 to make use of value2 instead of the lower cased value:

 

if(bank_account.getBankAccountType() != null) {
   Element account_type_el = document.createElement(AuthNetField.ELEMENT_ACCOUNT_TYPE.getFieldName());			account_type_el.appendChild(document.getDocument().createTextNode(bank_account.getBankAccountType().getValue2()));
 				bankacct_el.appendChild(account_type_el);
 }

I had to overwrite the api to gdet these use cases working. There has not been a new version for a long time it seems. Please forward to the appropiate development team. A new version is long overdue. Thanks.

Posts: 2,765
Topics: 57
Kudos: 270
Blog Posts: 67
Registered: ‎12-05-2011

Re: Java SDK Bugs Report

Hello @bmorales1

 

I've reported your issue to the product team.  An update to the Java SDK is underway, but I don't yet have a time line for completion.

I'd recommend subscribing to this topic so that you'll be alerted via email if there are updates. To subscribe, click Topic Options at the top of this thread and then select Subscribe. You'll then receive an email once anyone replies to your post.

Thanks,

Richard

Member
Posts: 2
Registered: ‎02-14-2014

Re: Java SDK Bugs Report

I have subscribed. Thank you.

Posts: 2,765
Topics: 57
Kudos: 270
Blog Posts: 67
Registered: ‎12-05-2011

Re: Java SDK Bugs Report

This issue is now resolved and an updated SDK is available from GitHub: https://github.com/AuthorizeNet/sdk-java.

 

Richard