cancel
Showing results for 
Search instead for 
Did you mean: 

Ruby bug: card_type incorrectly contains last 4 digits of card number

We have an application that uses the Ruby authorize-net gem (version 1.5.2).  After transactions we display the card type and last 4 digits of account_number.  In testing against the sandbox this works fine.  We just deployed to production, and what we are seeing:

 

response.card_type - contains the last 4 of the card number, e.g.' XXXX1234'

response.fields[:account_number] - empty

 

At first I thought this was just a formatting error on our part, but I dumped the AuthorizeNet::AIM::Response object, and that has

...   :account_number=>"", :card_type=>"XXXX1234" ...

in the @fields hash.  So either the values are being returned incorrectly or the Ruby library is parsing them incorrectly.

 

Is there a fix for this?  Anyone else run into something similiar?

 

Thanks - Dave

murdocj
Member
1 ACCEPTED SOLUTION

Accepted Solutions

That not because special characters, it the delimited char.

http://developer.authorize.net/guides/AIM/wwhelp/wwhimpl/js/html/wwhelp.htm#href=4_TransResponse.htm...

 

You might be able to change that in the SDK

View solution in original post

4 REPLIES 4

Additional information: we are using AIM for integration.  The transaction is accepted and we get a successful response. 

murdocj
Member

More info: I looked more closely at the response.  The error is apparently due to the original street address including a comma.  It was something like

 

   111 Jones St, PO Box 12345

 

On the parsing of the response, apparently this thru the authorize_net ruby code off, because I can see that everything got shifted over: the street became "111 Jones St", the city is "PO Box 12345", etc. 

 

So it looks like there's a bug at least commas in the input can cause problems in parsing the reply.  Is there a list of special characters that we should be filtering when submitting transactions?

That not because special characters, it the delimited char.

http://developer.authorize.net/guides/AIM/wwhelp/wwhimpl/js/html/wwhelp.htm#href=4_TransResponse.htm...

 

You might be able to change that in the SDK

Thanks, that is the problem.  The Ruby gem defaults the delimiter to be comma, which is not the best choice. It's an option when creating the transaction so it's easy to modify.