I'm having an issue getting authorize.net to run credit card transactions from my rails app.
Here is what is in my environment.rb
if ENV['RAILS_ENV'] != 'production'
::GATEWAY = gateway = ActiveMerchant::Billing::Base.gateway(:authorize_net).new(
:login => "scrubbed",
:password => "scrubbed")
else
::GATEWAY = gateway = ActiveMerchant::Billing::Base.gateway(:authorize_net).new(
:login => "scrubbed",
:password => "scrubbed", :test => 'true')
end
I'm following Ryan Bates Railscast for integration - this is what is in the order model
def purchase
response = GATEWAY.purchase(price_in_cents, credit_card, purchase_options)
transactions.create!(:action => "purchase", :amount => price_in_cents, :response => response)
cart.update_attribute(:purchased_at, Time.now) if response.success?
response.success?
end
i've debugged the output and everything seems to be properly sent but it's returning the following error:
GATEWAY.purchase(price_in_cents, credit_card, purchase_options)#<ActiveMerchant::Billing::Response:0x1066efda0 @fraud_review=false, @params={"response_reason_text"=>"The merchant login ID or password is invalid or the account is inactive.", "transaction_id"=>"0", "response_code"=>3, "response_reason_code"=>"13", "avs_result_code"=>"P", "card_code"=>nil}, @message="The merchant login ID or password is invalid or the account is inactive", @avs_result={"code"=>"P", "postal_match"=>"Y", "street_match"=>"N", "message"=>"Postal code matches, but street address not verified."}, @test=true, @authorization="0", @success=false, @cvv_result={"code"=>nil, "message"=>nil}>
I've checked the API Key and Trans Key and both are correct. Authorize.net is set to test mode on their end but i don't think that should cause the issue...
any help would be greatly appreciated...