Showing results for 
Search instead for 
Did you mean: 

DPM relay_response params show success, but AuthorizeNet::SIM::Response object says otherwise

Using DPM with my RoR website.


Posting a transaction directly to from my form works correctly. The transaction appears in my "dashboard" on, everything is good.


I send along a relay_response_url for to POST the response. Here is my code to receive and parse that response:


# Returns relay response when Authorize.Net POSTs to us.
def relay_response
  sim_response =
  success = sim_response.success?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])
  transaction = @order.transactions.create({success: success, message: params[:x_response_reason_text], transaction_id: params[:x_trans_id]})
    if success "worked"
    else "didn't work"
    render text: sim_response.direct_post_reply(customer_order_url(@customer, @order, only_path: false), include: true)


This is getting hit properly. 'params' is the set of parameters that sends along in their POST response. params[:x_response_code] = "1". params[:x_response_reason_text] = "This transaction has been approved." It seems like according to the params send back from, everything is valid, and this is a successful transaction (and it shows successful on the dashboard as well).



sim_response.success?(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['merchant_hash_value'])

returns back false. 


My api_login_id and merchant_hash_value are correct as far as I can tell. I set my local merchant_hash_value to the same thing that I typed into the form on the page to set the hash value.


What is going on in the success? function?


I realise that I can probably just look at the "x_response_code" param to see if it's "1" or not, and use that to determine if the transaction was sucessful or not, but the test project from is using this function so I feel I should be able to use it too, but "it's not working" from my point of view.


I can provide more details if needed. Any ideas?




Make sure your hash_value wasn't too long (more then 20) or it will get truncate on side.