8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/friendly_shipping/services/ups_freight/generate_freight_rate_request_hash.rb', line 8
def call(shipment:, options:)
{
FreightRateRequest: {
Request: request_options(options.customer_context),
ShipperNumber: options.shipper_number,
ShipFrom: GenerateLocationHash.call(location: shipment.origin),
ShipTo: GenerateLocationHash.call(location: shipment.destination),
PaymentInformation: payment_information(options),
Service: {
Code: options.shipping_method.service_code
},
Commodity: options.commodity_information_generator.call(shipment: shipment, options: options),
TimeInTransitIndicator: 'true',
PickupRequest: GeneratePickupRequestHash.call(pickup_request_options: options.pickup_request_options),
}.compact.
merge(GenerateHandlingUnitsHash.call(shipment: shipment, options: options))
}
end
|