Invalid Authorize.net Account

32 views
Skip to first unread message

dasil003

unread,
May 3, 2007, 1:03:29 PM5/3/07
to Active Merchant
Thanks for the response to my last question Cody, it's really cool
that you take the time to answer questions here on a regular basis. I
have AM set up successfully for a client's paypal pro, but now I'm
having problems with authorize.net

I set it up basically just like the demo on the AM front page:

gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new(:login =>
login, :password => password)

Where password is my transaction key. The login and key are current
and functional (we are using them in other non-ruby apps), but when I
do:

response = gateway.authorize(1000, creditcard)

I get back:

#<ActiveMerchant::Billing::AuthorizeNetGateway:0x37d66a4
@ssl_strict=false,
@response={:transaction_id=>"0", :avs_message=>"Address verification
not applicable for this
transaction", :response_reason_code=>"13", :response_reason_text=>"The
merchant login ID or password is invalid or the account is
inactive.", :avs_result_code=>"P", :response_code=>3, :card_code=>nil},
@options={:login=>"xxxxxx", :password=>"XXXXXXX"}>

I'm just running this in a console for testing. Any ideas?

Cody Fauser

unread,
May 3, 2007, 1:23:19 PM5/3/07
to activem...@googlegroups.com
Is the account you're trying to use a test Authorize.net account?

You have to make sure that the account you're using matches the
environment, and thus URL endpoint, that ActiveMerchant uses.

For example, if you have a test Authorize.net account you would want
to make sure that ActiveMerchant is running in the test mode. It runs
in production mode by default.

# Test mode
ActiveMerchant::Billing::Base.gateway_mode = :test

# Production mode (default if no mode is set)
ActiveMerchant::Billing::Base.gateway_mode = :production


--
Cody Fauser
http://shopify.com - e-commerce done right
http://www.codyfauser.com - blog
http://www.oreilly.com/catalog/rjsrails - RJS Templates for Rails

dasil003

unread,
May 3, 2007, 1:53:22 PM5/3/07
to Active Merchant
It is a regular live account that we are using for business, so it
can't be set to test mode on the authorize.net config. I did issue a

ActiveMerchant::Billing::Base.gateway_mode = :test

To set it to test mode on a per-transaction basis, but maybe that's
not how it works? I believe our other apps use the X_TEST_REQUEST
field to process test transactions with a live account.

Are test accounts totally isolated from regular accounts (ie. regular
account can't use the test server)? In the integration guide I also
noticed a third subdomain https://certification.authorize.net/.

On May 3, 11:23 am, "Cody Fauser" <codyfau...@gmail.com> wrote:
> Is the account you're trying to use a test Authorize.net account?
>
> You have to make sure that the account you're using matches the
> environment, and thus URL endpoint, that ActiveMerchant uses.
>
> For example, if you have a test Authorize.net account you would want
> to make sure that ActiveMerchant is running in the test mode. It runs
> in production mode by default.
>
> # Test mode
> ActiveMerchant::Billing::Base.gateway_mode = :test
>
> # Production mode (default if no mode is set)
> ActiveMerchant::Billing::Base.gateway_mode = :production
>

dasil003

unread,
May 3, 2007, 2:01:55 PM5/3/07
to Active Merchant
Okay, I added the line:

post[:test_request] = @options[:test] ? "TRUE" : "FALSE"

In the post_data method so you can do per-connection testing of live
accounts and it worked like a charm. Not sure if you'd like to
include it.

Cody Fauser

unread,
May 3, 2007, 2:10:20 PM5/3/07
to activem...@googlegroups.com
That code is already there. Basically, the way it works is if you are
using a test account then you set
ActiveMerchant::Billing::Base.gateway_mode = :test so that you're
using the TEST_URL.

If you want to set x_test_request to true for any request with a live
or test account then you construct the gateway with the :test => true
option.

In summary, :test => true sets x_test_request and the
Base.gateway_mode changes the endpoint URL. You can actually set
x_test_request to true on requests going to the test server.

On 5/3/07, dasil003 <gabr...@gmail.com> wrote:
>

dasil003

unread,
May 3, 2007, 2:27:38 PM5/3/07
to Active Merchant
LOL. I even implemented it the same as you. I guess I should have
looked at the code closer. Thanks again.

On May 3, 12:10 pm, "Cody Fauser" <codyfau...@gmail.com> wrote:
> That code is already there. Basically, the way it works is if you are
> using a test account then you set
> ActiveMerchant::Billing::Base.gateway_mode = :test so that you're
> using the TEST_URL.
>
> If you want to set x_test_request to true for any request with a live
> or test account then you construct the gateway with the :test => true
> option.
>
> In summary, :test => true sets x_test_request and the
> Base.gateway_mode changes the endpoint URL. You can actually set
> x_test_request to true on requests going to the test server.
>

> On 5/3/07, dasil003 <gabrie...@gmail.com> wrote:
>
>
>
> > Okay, I added the line:
>
> > post[:test_request] = @options[:test] ? "TRUE" : "FALSE"
>
> > In the post_data method so you can do per-connection testing of live
> > accounts and it worked like a charm. Not sure if you'd like to
> > include it.
>
> --

Cody Fauser

unread,
May 3, 2007, 2:37:06 PM5/3/07
to activem...@googlegroups.com
Ha ha, at least it works one way or another ;)

On 5/3/07, dasil003 <gabr...@gmail.com> wrote:
>

Reply all
Reply to author
Forward
0 new messages