shippinglogic icon indicating copy to clipboard operation
shippinglogic copied to clipboard

ArgumentError: wrong number of arguments (1 for 2) when creating ups.ship object

Open dazl opened this issue 14 years ago • 0 comments

I get an ArgumentError: wrong number of arguments (1 for 2) when creating a ups.ship object as in the code snippet below.

I get a different trace depending on which ruby version I am using but always the same error.

Thanks in advance for any help, david

This is what I wrote in irb -- I am not sure I am writing the service_type the correct way or if I am missing some required parameters.

require 'shippinglogic'
ups = Shippinglogic::UPS.new( ....removed.... ,{:test=>true})
shipment = ups.ship(:shipper_name => 'Test Shipper',
:shipper_company_name => 'Shipper Company Name',
:shipper_phone_number => '9012638716',
:shipper_streets => 'Address Line 1',
:shipper_city => 'Austin',
:shipper_state => 'TX',
:shipper_postal_code => '73301',
:shipper_country => 'US',

:recipient_name => 'Test Recipient',
:recipient_company_name => 'Recipient Company Name',
:recipient_phone_number => '9012637906',
:recipient_streets => 'Address Line 1',
:recipient_city => 'Herndon',
:recipient_state => 'VA',
:recipient_postal_code => '20171',
:recipient_country => 'US',
:recipient_residential => true,

:package_weight => 10.0,
:package_length => 20,
:package_width => 20,
:package_height => 10,

:service_type => "02")

1.8.7 (ree and standard built into mac os 10.6)

ArgumentError: wrong number of arguments (1 for 2)
from {...}/shippinglogic/ups/error.rb:38:in `initialize'
from {...}/shippinglogic/ups/error.rb:38:in `initialize'
from {...}/shippinglogic/ups/response.rb:17:in `new'
from {...}/shippinglogic/ups/response.rb:17:in `request'
from {...}/shippinglogic/ups/ship_confirm.rb:70:in `target'
from {...}/shippinglogic/proxy.rb:20:in `method_missing'
from {...}/shippinglogic/ups.rb:74:in `ship'
from (irb):3

1.9.2

ArgumentError: wrong number of arguments (1 for 2)
from {...}shippinglogic/error.rb:5:in `initialize'
from {...}shippinglogic/ups/error.rb:38:in `initialize'
from {...}shippinglogic/ups/response.rb:17:in `new'
from {...}shippinglogic/ups/response.rb:17:in `request'
from {...}shippinglogic/ups/ship_confirm.rb:70:in `target'
from {...}shippinglogic/proxy.rb:20:in `method_missing'
from {...}shippinglogic/ups.rb:74:in `ship'
from (irb):3

dazl avatar Sep 06 '10 18:09 dazl