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>
Solved! Go to Solution.
06-14-2012 04:17 PM
Probably go in and modify the source.
06-14-2012 05:44 PM
Look like a bug in the createCustomerPaymentProfile(). It missing addCardCode(document);
06-14-2012 04:39 PM
06-14-2012 05:25 PM
Probably go in and modify the source.
06-14-2012 05:44 PM
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?
06-15-2012 06:58 AM
Inside the SDK zip file there is a src directory with the source.
06-15-2012 07:00 AM - edited 06-15-2012 07:01 AM
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!
06-15-2012 08:04 AM
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
06-18-2012 09:46 AM