cancel
Showing results for 
Search instead for 
Did you mean: 

Adding bank account payment profile in Java SDK

Here's another fun feature of the Java SDK (anet_java_sdk-1.4.6) - you can't add a businessChecking payment profile currently - you'll get a message like this:

 

<message><code>E00003</code><text>The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:accountType' element is invalid - The value 'businesschecking' is invalid according to its datatype 'AnetApi/xml/
v1/schema/AnetApiSchema.xsd:bankAccountTypeEnum' - The Enumeration constraint failed.</text></message>

 

The AccountType must be "businessChecking" not "businesschecking".

 

To fix this you have to change the source code for the SDK.

 

In net.authorize.data.echeck.BankAccountType they have:

 

public enum BankAccountType implements Serializable {
	CHECKING("CHECKING"),
	BUSINESSCHECKING("BUSINESSCHECKING"),
	SAVINGS("SAVINGS"),
	UNKNOWN("UNKNOWN");

 I changed to:

 

public enum BankAccountType implements Serializable {
	CHECKING("checking"),
	BUSINESSCHECKING("businessChecking"),
	SAVINGS("savings"),
	UNKNOWN("unknown");

 

In net.authorize.cim.Transaction.java addPayment method they have:

 

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

 I changed to:

 

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()));
	bankacct_el.appendChild(account_type_el);
}

This works for my purposes - YMMV. I've reported these issues/fixes to developer@authorize.net but I get no response from them.  

 

 

gregberger
Member
1 REPLY 1

Thanks gregberger, we'll be sure to pass this information on to the development team.

 

Richard

RichardH
Administrator Administrator
Administrator