cancel
Showing results for 
Search instead for 
Did you mean: 

Determining if a transaction was successful (ruby gem)

 

All of the Ruby sample code defines a successful transaction this way:

if response.messages.resultCode == MessageTypeEnum::Ok
      puts "Successful charge (auth + capture)...

               (authorization code: #{response.transactionResponse.authCode})"

 

(FYI, MessageTypeENum::Ok ='s "Ok")


However, we are getting a resultCode of 'Ok' but when we check Authorizenet itself, we find that the transaction (charge) was declined.  We're using the 4111... test card number and the 46282 zip code.  Our sandbox account is in LIVE mode.

We have determined that it is necessary to do this:

if @processor_response_raw.messages.resultCode == 'Ok' &&  @processor_response_raw.transactionResponse.responseCode == '1'

Both the resultCode and responseCode must be checked.

Every one of the 49 examples in the Ruby sample code only checks resultCode. 

1 REPLY 1

Thanks @loginfromthe101 I've passed this on to the developers.

 

Richard

RichardH
Administrator Administrator
Administrator