Reply
Highlighted
Member
Posts: 3
Registered: ‎12-30-2011

Java CIM SDK not returning bank account payment info for getCustomerProfileRequest

[ Edited ]

I've tracked down an issue with the Java CIM SDK. CIM SDK (v1.4.6) is not returning bank account payment info for the getCustomerProfileRequest. After a little debugging, it seems like there is an issue in the following method's parsing code. 

 

I've corrected it locally and everything works fine now, however I would appreciate if this fix was integrated into the main distribution so that future versions work correctly for all.

 

Class:

net.authorize.cim.Result

 

Method:

private void importPaymentInfo(Element root_el, PaymentProfile paymentProfile)

 

Before:

		if(bank_account_list.getLength() != 0) {
			Element bank_account_el = (Element)bank_account_list.item(0);
			BankAccount bankAccount = BankAccount.createBankAccount();
			bankAccount.setBankAccountType(BankAccountType.findByValue(
					getElementText(bank_account_el, AuthNetField.ELEMENT_ACCOUNT_TYPE.getFieldName())));
			bankAccount.setRoutingNumber(getElementText(bank_account_el, AuthNetField.ELEMENT_ROUTING_NUMBER.getFieldName()));
			bankAccount.setBankAccountNumber(getElementText(bank_account_el, AuthNetField.ELEMENT_ACCOUNT_NUMBER.getFieldName()));
			bankAccount.setBankAccountName(getElementText(bank_account_el, AuthNetField.ELEMENT_NAME_ON_ACCOUNT.getFieldName()));
			bankAccount.setBankName(getElementText(bank_account_el, AuthNetField.ELEMENT_BANK_NAME.getFieldName()));
			
		}

 After:

		if(bank_account_list.getLength() != 0) {
			Element bank_account_el = (Element)bank_account_list.item(0);
			BankAccount bankAccount = BankAccount.createBankAccount();
			bankAccount.setBankAccountType(BankAccountType.findByValue(
					getElementText(bank_account_el, AuthNetField.ELEMENT_ACCOUNT_TYPE.getFieldName())));
			bankAccount.setRoutingNumber(getElementText(bank_account_el, AuthNetField.ELEMENT_ROUTING_NUMBER.getFieldName()));
			bankAccount.setBankAccountNumber(getElementText(bank_account_el, AuthNetField.ELEMENT_ACCOUNT_NUMBER.getFieldName()));
			bankAccount.setBankAccountName(getElementText(bank_account_el, AuthNetField.ELEMENT_NAME_ON_ACCOUNT.getFieldName()));
			bankAccount.setBankName(getElementText(bank_account_el, AuthNetField.ELEMENT_BANK_NAME.getFieldName()));
			
			//This was missing.. paymentProfile.addPayment(Payment.createPayment(bankAccount));
		}

 

Thanks,

Derek

Highlighted
Member
Posts: 3
Registered: ‎12-30-2011

Re: Java CIM SDK not returning bank account payment info for getCustomerProfileRequest

I've tracked down another issue similar to this one. CIM SDK (v1.4.6) is not returning back phone numbers within the profile info. I've corrected it locally and everything works fine now, however I would appreciate if this fix was integrated into the main distribution so that future versions work correctly for all.

 

Class:

net.authorize.cim.Result

 

Method:

private void importBillTo(Element root_el, PaymentProfile paymentProfile)

 

Before:

if(bill_to_list.getLength() == 1) {
    Element bill_to_el = (Element)bill_to_list.item(0);
    Address billTo = Address.createAddress();
    billTo.setFirstName(getElementText(bill_to_el, AuthNetField.ELEMENT_FIRST_NAME.getFieldName()));
    billTo.setLastName(getElementText(bill_to_el, AuthNetField.ELEMENT_LAST_NAME.getFieldName()));
    billTo.setCompany(getElementText(bill_to_el, AuthNetField.ELEMENT_COMPANY.getFieldName()));
    billTo.setAddress(getElementText(bill_to_el, AuthNetField.ELEMENT_ADDRESS.getFieldName()));
    billTo.setCity(getElementText(bill_to_el, AuthNetField.ELEMENT_CITY.getFieldName()));
    billTo.setState(getElementText(bill_to_el, AuthNetField.ELEMENT_STATE.getFieldName()));
    billTo.setZipPostalCode(getElementText(bill_to_el, AuthNetField.ELEMENT_ZIP.getFieldName()));
    billTo.setCountry(getElementText(bill_to_el, AuthNetField.ELEMENT_COUNTRY.getFieldName()));
    paymentProfile.setBillTo(billTo);
}

 

After:

if(bill_to_list.getLength() == 1) {
    Element bill_to_el = (Element)bill_to_list.item(0);
    Address billTo = Address.createAddress();
    billTo.setFirstName(getElementText(bill_to_el, AuthNetField.ELEMENT_FIRST_NAME.getFieldName()));
    billTo.setLastName(getElementText(bill_to_el, AuthNetField.ELEMENT_LAST_NAME.getFieldName()));
    billTo.setCompany(getElementText(bill_to_el, AuthNetField.ELEMENT_COMPANY.getFieldName()));
    billTo.setAddress(getElementText(bill_to_el, AuthNetField.ELEMENT_ADDRESS.getFieldName()));
    billTo.setCity(getElementText(bill_to_el, AuthNetField.ELEMENT_CITY.getFieldName()));
    billTo.setState(getElementText(bill_to_el, AuthNetField.ELEMENT_STATE.getFieldName()));
    billTo.setZipPostalCode(getElementText(bill_to_el, AuthNetField.ELEMENT_ZIP.getFieldName()));
    billTo.setCountry(getElementText(bill_to_el, AuthNetField.ELEMENT_COUNTRY.getFieldName()));
   billTo.setPhoneNumber(getElementText(bill_to_el, AuthNetField.ELEMENT_PHONE_NUMBER.getFieldName()));
    paymentProfile.setBillTo(billTo);
}

 

Highlighted
Moderator
Posts: 591
Registered: ‎08-21-2009

Re: Java CIM SDK not returning bank account payment info for getCustomerProfileRequest

Thanks a lot for the great details!  I'll be sure to pass it on to our developers so that they can include it in the next update.

Highlighted
Member
Posts: 3
Registered: ‎12-30-2011

Re: Java CIM SDK not returning bank account payment info for getCustomerProfileRequest

It's unacceptable that this fix still hasn't been integrated into the Java SDK.  There hasn't been a new release of the Java SDK for over 2 years now...

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

Re: Java CIM SDK not returning bank account payment info for getCustomerProfileRequest

Hello,

 

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

 

Richard