@@ -48,16 +48,16 @@ def _extract_shipment(
4848 base_amount = lib .failsafe (lambda : info .shipment_price .base_amount )
4949 service_code = lib .failsafe (lambda : info .shipment_price .service_code )
5050 service = provider_units .ServiceType .map (service_code )
51- adjustments = getattr ( info .shipment_price .adjustments , " adjustment" , [])
52- priced_options = getattr ( info .shipment_price .priced_options , " priced_option" , [])
53- charges = [
51+ adjustments = lib . failsafe ( lambda : info .shipment_price .adjustments . adjustment ) or []
52+ priced_options = lib . failsafe ( lambda : info .shipment_price .priced_options . priced_option ) or []
53+ charges = lib . failsafe ( lambda : [
5454 ("Base charge" , info .shipment_price .base_amount ),
5555 ("GST" , info .shipment_price .gst_amount ),
5656 ("PST" , info .shipment_price .pst_amount ),
5757 ("HST" , info .shipment_price .hst_amount ),
5858 * ((f"Option { o .option_code } " , o .option_price ) for o in priced_options ),
5959 * ((a .adjustment_code , a .adjustment_amount ) for a in adjustments ),
60- ]
60+ ]) or []
6161
6262 return models .ShipmentDetails (
6363 carrier_name = settings .carrier_name ,
0 commit comments