ActiveShipping Ups无法获取运输标签。托运人姓名丢失或无效

时间:2015-03-13 09:17:13

标签: ruby-on-rails ruby

我尝试使用active_shpping gem创建运费。我不确定我是否正确地做了一切,但每当我尝试创建货物时我得到了Runtime Error Could not obtain shipping label. Missing or invalid shipper name.。为了重现这个问题:

packages = [
  ActiveMerchant::Shipping::Package.new( 100, [93,10]),
  ActiveMerchant::Shipping::Package.new( 100, [93,10])
]

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

destination = ActiveMerchant::Shipping::Location.new( :country => 'CA', :province => 'ON', :city => 'Ottawa', :postal_code => 'K1P 1J1')
ups = ActiveMerchant::Shipping::UPS.new(:login => 'my-working-login', :password => 'my-working-password', :key => 'my-working-ups-key')

ups.create_shipment(origin, destination, packages)

我错过了任何参数吗?或者也许不支持通过UPS创建发货?

0 个答案:

没有答案