I found a critical bug in the Java SDK v 1.4.3. When I create a CIM createCustomerProfileTransactionRequest transaction, I do not provide a cardCode value. The SDK is generating XML that includes an empty-element for cardCode, when cardCode is set to null in the Java SDK. This is incorrect behavior. The SDK should not include the cardCode XML element at all, when not set. The error that I kept getting from the SDK is:
The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:cardCode' element is invalid - The value '' is invalid
To fix this, I had to explicity remove <cardCode></cardCode> from the generated XML and it started working again.
You can fix this problem in the SDK by editing net.authorize.cim.Transaction and only conditionally running the following piece of code if the cardCode is a non-null and non-empty-string value:
// card code
Element card_code_el = document.createElement(AuthNetField.ELEMENT_CARD_CODE.getFieldName());
card_code_el.appendChild(document.getDocument().createTextNode(this.paymentTransaction.getCardCode()));
profile_trans_x_el.appendChild(card_code_el);
05-06-2011 10:28 AM
Hi tonic-bom,
Thanks for the heads up! I've reported your bug find to our development teams so that they can include a fix for it in an upcoming release.
Thanks,
Michelle
Developer Community Manager
05-16-2011 02:21 PM
michelle,
has your development team fixed the cardCode (cvv) bug?
thanks,
cron
12-13-2011 01:31 AM
Hey there,
Yes, I believe this was fixed with the last release. Let us know if you're still seeing it though!
Thanks,
Michelle
Developer Community Manager
12-19-2011 10:49 AM