active_shipping icon indicating copy to clipboard operation
active_shipping copied to clipboard

UPS Price incorect

Open shuhrat10 opened this issue 11 years ago • 8 comments

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')

shuhrat10 avatar Nov 07 '13 03:11 shuhrat10

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

csaunders avatar Nov 20 '13 20:11 csaunders

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', origin_account: '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!

  • Shukhrat.

On Wed, Nov 20, 2013 at 3:51 PM, Christopher Saunders < [email protected]> 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 .

shuhrat10 avatar Nov 20 '13 22:11 shuhrat10

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.

sachin004 avatar Feb 05 '14 13:02 sachin004

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

csaunders avatar Feb 05 '14 14:02 csaunders

@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 avatar Feb 05 '14 16:02 sachin004

@csaunders I think this issue can be closed now.

sachin004 avatar Feb 05 '14 16:02 sachin004

: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.

csaunders avatar Feb 05 '14 16:02 csaunders

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

Thanks!

On Wed, Feb 5, 2014 at 11:26 AM, Christopher Saunders < [email protected]> 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 .

shuhrat10 avatar Feb 06 '14 01:02 shuhrat10