2011-10-04 70 views
1

我試圖讓航運從聯邦快遞率與active_shipping寶石:軌active_shipping聯邦快遞率請求失敗

packages = [ 
    Package.new(
    100,      # 100 grams 
    [93,10],     # 93 cm long, 10 cm diameter 
    :cylinder => true),   # cylinders have different volume calculations 

    Package.new(
    (7.5 * 16),  # 7.5 lbs, times 16 oz/lb. 
    [15, 10, 4.5],    # 15x10x4.5 inches 
    :units => :imperial 
    )  # not grams, not centimetres 
] 

origin = Location.new(
    :country => 'US', 
    :state => 'CA', 
    :city => 'Beverly Hills', 
    :zip => '90210' 
) 

destination = Location.new(
    :country => 'CA', 
    :province => 'ON', 
    :city => 'Ottawa', 
    :postal_code => 'K1P 1J1' 
) 

options = { 
    :login => '***', 
    :password => '***', 
    :key => '***', 
    :account => '***', 
    :meter => '***', 
    :test => true 
} 

fedex = FedEx.new(options) 

rates = fedex.find_rates(origin, destination, packages) 

但我得到803錯誤:

錯誤 - 803:電錶號丟失或無效。
有誰知道如何解決這個問題? 謝謝!

+0

可能的重複http://stackoverflow.com/questions/5795902/active-shipping-fedex-api-authentication-error –

回答

2

您是否傳遞了有效憑證?

options = { 
    :login => '***', 
    :password => '***', 
    :key => '***', 
    :account => '***', 
    :meter => '***', 
    :test => true 
} 

在FedEx Dev站點設置憑據時,它將提供測試憑證和生產憑證。確保你使用正確的測試儀#。