Reply
Highlighted
Member
Posts: 5
Registered: ‎09-20-2013
Accepted Solution

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


Accepted Solutions
Highlighted
Solution
Accepted by topic author murdocj
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

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

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


All Replies
Highlighted
Member
Posts: 5
Registered: ‎09-20-2013

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

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

Highlighted
Member
Posts: 5
Registered: ‎09-20-2013

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

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?

Highlighted
Solution
Accepted by topic author murdocj
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

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

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

Highlighted
Member
Posts: 5
Registered: ‎09-20-2013

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

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.