Showing results for 
Search instead for 
Did you mean: 

Java SDK with CIM not sending CCV

Hi there,


I'm using CIM through the Java SDK, and I'm having a problem getting the CCV to be validated when I attempt to create a customer profile.


I have gone through testing in the various environments, but I'm now at the point where I am using live mode on the production servers with valid credit card information.  With the valid credit card information I'm trying to submit an invalid CCV to get a rejection, but my customer profiles keep getting accepted.


I ended up examining the XML by doing result.getTarget().getCurrentRequest().dump(), and it looks like the CCV isn't getting included in the outgoing request XML.  Any ideas why this would be happening?  I've replaced personal information from the XML below, but I didn't remove anything.  I assume there is supposed to be a <cardCode> element inside <creditCard>?  I've verified by stepping through in my debugger that the card code is being set on the CreditCard Java object.


I'm using the API from anet-java-sdk-1.4.6.jar.  Let me know if you would like any more info.  Thanks!


<?xml version="1.0"?>
<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
abc123      </name>
abc123      </transactionKey>
9870      </merchantCustomerId>
      <email>      </email>
individual         </customerType>
John            </firstName>
Doe            </lastName>
123 Main St            </address>
New York            </city>
NY            </state>
12345            </zip>
1234432112344321               </cardNumber>
2015-01               </expirationDate>
liveMode   </validationMode>




Accepted Solutions

Probably go in and modify the source.

View solution in original post


Look like a bug in the createCustomerPaymentProfile(). It missing addCardCode(document);


OK...any suggestions for a workaround or a fix?

Probably go in and modify the source.

I'm new to  All I have is the anet-java-sdk-1.4.6 jar and that only contains the .class files.   Where do I get the source code?

Inside the SDK zip file there is a src directory with the source.

Ooops, sorry, should have checked that first :)


For future reference, I ended up adding the following inside net.authorize.cim.Transaction.addPayment, right after it adds the credit card expiration date:


Element card_code_el = document.createElement(AuthNetField.ELEMENT_CARD_CODE.getFieldName());


Thanks so much for your help and prompt response!

Hey you two,


Thanks for pointing out this bug and for posting your solution, jonathanmgrimm. I've forwarded the bug on to our developers so that they can include a fix for it in an upcoming release. 





Developer Community Manager