Reputation: 6475
I have deployed my live app with working payment gateway but I still need somewhere to test so created a account with sandbox.authorize.net and got a new api key.
Now when I try these details in development/staging I get -
User authentication failed due to invalid authentication values
When accessing authorize.net
Does active merchant work with sandbox.authorize.net? testing seems to work fine with a gateway set in test mode but not with a sandbox account.
Upvotes: 0
Views: 1182
Reputation: 6475
I managed to get this working with the following code:
ActiveMerchant::Billing::Base.mode = :test
ActiveMerchant::Billing::AuthorizeNetCimGateway.new(
:login => login,
:password => password
)
Orginally my connector looked like this(as the api shows it):
ActiveMerchant::Billing::AuthorizeNetCimGateway.new(
:login => login,
:password => password,
:test true
)
Upvotes: 2
Reputation: 219794
That's probably because test mode uses your live account's test mode and doesn't actually point to the development server for Authnet. I don't know how Active Merchant is written but it may require you changing the URL manually for testing and then returning its original value when testing is complete.
Upvotes: 0