lib/active_shipping/carriers/ups.rb in active_shipping-1.6.5 vs lib/active_shipping/carriers/ups.rb in active_shipping-1.7.0
- old
+ new
@@ -1,10 +1,11 @@
# -*- encoding: utf-8 -*-
module ActiveShipping
class UPS < Carrier
self.retry_safe = true
+ self.ssl_version = :TLSv1_2
cattr_accessor :default_options
cattr_reader :name
@@name = "UPS"
@@ -530,13 +531,15 @@
end
xml.Weight([value.round(3), 0.1].max)
end
- xml.InvoiceLineTotal do
- xml.CurrencyCode('USD')
- total_value = packages.inject(0) {|sum, package| sum + package.value}
- xml.MonetaryValue(total_value)
+ if packages.any? {|package| package.value.present?}
+ xml.InvoiceLineTotal do
+ xml.CurrencyCode('USD')
+ total_value = packages.inject(0) {|sum, package| sum + package.value.to_i}
+ xml.MonetaryValue(total_value)
+ end
end
xml.PickupDate(pickup_date.strftime('%Y%m%d'))
end
end