cancel
Showing results for 
Search instead for 
Did you mean: 

CIM cardCode bug in Java SDK v 1.4.3

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);

 

 

 

 

 

tonic-bom
Member
3 REPLIES 3

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

Michelle
All Star

michelle,

has your development team fixed the cardCode (cvv) bug? 

 

thanks,

cron

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