问题
I'm implementing aсtive_shipping plugin functionality in my app. I've got test account from fedex and trying to get some shipping rates as shown in plugin's readme at github:
fedex = FedEx.new(:login => '***', :password => '***', :key => '***',
:account => '510087569', :meter => '100054531')
response = fedex.find_rates(origin, destination, packages)
This request causes an error: ActiveMerchant::Shipping::ResponseError (ERROR - 1000: Authentication Failed)
Also I'm confused with all that APIs keys (DHL, UPS etc). Can I use same account keys in different apps for each of carriers or should I make new ones for every app?
回答1:
You should pass :test => true
in with your other options to let it know to use the test URL rather than the production URL.
You can see all the options and details here
https://github.com/Shopify/active_shipping/blob/master/lib/active_shipping/shipping/carriers/fedex.rb
In particular, make sure your other options are these:
# :key is your developer API key
# :password is your API password
# :account is your FedEx account number
# :login is your meter number
回答2:
How to get key, password, meter number, account number
here some step to follow,
first get login to www.fedex.com/developer, once get login select Fedex **web services for
shipping** then select Develope & Test Your application then click on Obtain test key then
you will get one form fill that form and accept the agreement after submitting form you will
get email from Fedex which consist of all this information.
Please note that login is your meter number
来源:https://stackoverflow.com/questions/5795902/active-shipping-fedex-api-authentication-error