【问题标题】:rails active_shipping Fedex rate request failsrails active_shipping Fedex 费率请求失败
【发布时间】:2011-10-04 12:53:13
【问题描述】:

我正在尝试使用 active_shipping gem 从fedex 获取运费:

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:仪表编号丢失或无效。
有谁知道如何解决这一问题? 谢谢!

【问题讨论】:

标签: ruby-on-rails shipping fedex


【解决方案1】:

您是否传递了有效的凭据?

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

在 FedEx Dev 站点设置凭据时,它将提供测试凭据和生产凭据。确保您使用的是正确的测试仪#。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多