cancel
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">
   <merchantAuthentication>
      <name>
abc123      </name>
      <transactionKey>
abc123      </transactionKey>
   </merchantAuthentication>
   <profile>
      <merchantCustomerId>
9870      </merchantCustomerId>
      <description>
      </description>
      <email>
foo@bar.com      </email>
      <paymentProfiles>
         <customerType>
individual         </customerType>
         <billTo>
            <firstName>
John            </firstName>
            <lastName>
Doe            </lastName>
            <company>
            </company>
            <address>
123 Main St            </address>
            <city>
New York            </city>
            <state>
NY            </state>
            <zip>
12345            </zip>
            <country>
            </country>
            <phoneNumber>
            </phoneNumber>
            <faxNumber>
            </faxNumber>
         </billTo>
         <payment>
            <creditCard>
               <cardNumber>
1234432112344321               </cardNumber>
               <expirationDate>
2015-01               </expirationDate>
            </creditCard>
         </payment>
      </paymentProfiles>
   </profile>
   <validationMode>
liveMode   </validationMode>
</createCustomerProfileRequest>

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Probably go in and modify the source.

View solution in original post

7 REPLIES 7

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

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

Probably go in and modify the source.

I'm new to Authorize.net.  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());
card_code_el.appendChild(document.getDocument().createTextNode(credit_card.getCardCode()));
cc_el.appendChild(card_code_el);

 

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. 

 

Thanks,

 

Michelle

Developer Community Manager