Shopify / active_shipping

ActiveShipping is a simple shipping abstraction library extracted from Shopify
http://shopify.github.io/active_shipping
MIT License
812 stars 546 forks source link

UPS Price incorect #120

Open shuhrat10 opened 10 years ago

shuhrat10 commented 10 years ago

Return wrong price from API Server

UPS Online Calculator return 9.75 API Return 9.71

@packages = [ Package.new( 2, [10,10,10], :units => :imperial ) ]

  @origin = Location.new(  :country => 'US',
                        :state => 'DC',
                        :city => 'WASHINGTON',
                        :zip => '20015',
                        :address_type => 'residential')

  @destination = Location.new( :country => 'US',
                        :state => 'NY',
                        :city => 'BROOKLYN',
                        :zip => '11201',
                        :address_type => 'residential')
csaunders commented 10 years ago

What is the difference between what we are generating and what the online calculator is generating?

Does the online generator give example XML on how to send the correct response? Until we get more information, all this issue tells us that we are using the API incorrectly somehow, but not how or why

shuhrat10 commented 10 years ago

I spent a lot of time to understand why price wrong so, when run request: response = ups.find_rates(origin, destination, packages) we should add {:pickup_type => :customer_counter} after packages. and also add account number, for example: ups = UPS.new(login: 'login', password: 'password', key: 'key', _originaccount: 'ups account number')

then works like a charm, another feature which really need now.

when you run request, you cannot get price if your total packages more 50 items, it would be nice if the api can take care about that.

For example: if the total number of boxes is 70, then send two request for 50 and 20 boxes and summarize the response amount and return the answer.

Thanks!

On Wed, Nov 20, 2013 at 3:51 PM, Christopher Saunders < notifications@github.com> wrote:

What is the difference between what we are generating and what the online calculator is generating?

Does the online generator give example XML on how to send the correct response? Until we get more information, all this issue tells us that we are using the API incorrectly somehow, but not how or why

— Reply to this email directly or view it on GitHubhttps://github.com/Shopify/active_shipping/issues/120#issuecomment-28929723 .

sachin004 commented 10 years ago

Hi @shuhrat10 FYI by default pickup_type is set to "daily_pickup"(options[:pickup_type] || :daily_pickup), so you have manually pass pickup_type in options otherwise you will get the rates for wholesale instead of retail.

csaunders commented 10 years ago

@sachin004 so if I understand correctly this isn't an actual bug but more a crappy documentation problem?

sachin004 commented 10 years ago

@csaunders Yes, you are correct its more of a documentation issue. It would be helpful for new developers if we could provide basic information(like assumptions that we are making in the code base), which helps to avoid to go through entire code base.

sachin004 commented 10 years ago

@csaunders I think this issue can be closed now.

csaunders commented 10 years ago

:heart:Cool! Thanks for the feedback.:heart:

I'm going to keep the issue open since there is a problem, it's just not a technical one. Updating docs will be required to close this.

shuhrat10 commented 10 years ago

yes, please update doc, I already find this option, forgot leave comment.

Thanks!

On Wed, Feb 5, 2014 at 11:26 AM, Christopher Saunders < notifications@github.com> wrote:

[image: :heart:]Cool! Thanks for the feedback.[image: :heart:]

I'm going to keep the issue open since there is a problem, it's just not a technical one. Updating docs will be required to close this.

Reply to this email directly or view it on GitHubhttps://github.com/Shopify/active_shipping/issues/120#issuecomment-34201617 .