Patches: Browse | Submit New | Admin

[#11591] UPS currency, price from label, and high value report

Date:
2007-06-15 03:54
Priority:
3
Submitted By:
Nobody
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
UPS currency, price from label, and high value report

Detailed description
Hi I can't seem to get a recent copy of shipping from svn, otherwise i would submit a patch. Anyhow,
when setting the insured value for generating a ups label it says that the CurrencyCode is invalid.  I believe it should
be USD instead of US.
Thus line 87 and 254 of ups.rb should be changed to USD instead of US.

Also, as an addition, I've found that the price returned from the price method in UPS is not always the same as the
price generated from the label.  Why this is, I'm not sure?  Thus I added another method called price to the label object
that is returned.   I added the line:
				response[:price] = REXML::XPath.first(@response,
"//ShipmentAcceptResponse/ShipmentResults/ShipmentCharges/TotalCharges/MonetaryValue").text

at line 312 in ups.rb.

Also another thing to point out.  I believe this is somewhat new but UPS also sends along an html file in
the ShipAcceptResponse called a High Value Report if the insured value is above $1000.00.  One has to handle this case
in order to get certification from UPS now.

I'm not sure if you want to include it in your API. But this line:
				response[:high_value_html] = Base64.decode64(REXML::XPath.first(@response,
"//ShipmentAcceptResponse/ShipmentResults/ControlLogReceipt/GraphicImage").text)

will put the html in the response hash.  You probably can just check if that element isnt nil, but maybe a better way
is to check for ErrorCode 120022.

Many thanks again for providing this wonderful package!
-Chris



Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item