Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for USPS Ground Advantage plus UPS SDK robustness #400

Merged
merged 2 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/extensions/ups/karrio/providers/ups/rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def rate_request(
else None
),
)
if any(options.pickup_options.state)
if options.pickup_options and options.pickup_options.state and any(options.pickup_options.state)
else None
),
DeliveryOptions=(
Expand All @@ -285,7 +285,7 @@ def rate_request(
else None
),
)
if any(options.delivery_options.state)
if options.delivery_options and options.delivery_options.state and any(options.delivery_options.state)
else None
),
RestrictedArticles=(
Expand Down
15 changes: 15 additions & 0 deletions sdk/extensions/usps/karrio/providers/usps/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ class ShipmentService(Enum):
usps_online = "Online"
usps_plus = "Plus"
usps_bpm = "BPM"
usps_ground_advantage = "Ground Advantage"
usps_ground_advantage_commercial = "Ground Advantage Commercial"
usps_ground_advantage_hfp = "Ground Advantage HFP"
usps_ground_advantage_hfp_commercial = "Ground Advantage HFP Commercial"
usps_ground_advantage_cubic = "Ground Advantage Cubic"


class ServiceClassID(Enum):
Expand Down Expand Up @@ -279,6 +284,14 @@ class ServiceClassID(Enum):
usps_bpm_flats_hold_for_pickup = "2020"
usps_parcel_select_ground_hold_for_pickup = "2071"
usps_bpm_parcels_hold_for_pickup = "2077"
usps_ground_advantage_cubic = "1096"
usps_ground_advantage_cubic_hold_for_pickup = "2096"
usps_ground_advantage_cubic_hazmat = "4096"
usps_ground_advantage_cubic_parcel_locker = "6096"
usps_ground_advantage = "1058"
usps_ground_advantage_hold_for_pickup = "2058"
usps_ground_advantage_hazmat = "4058"
usps_ground_advantage_parcel_locker = "6058"


class ServiceType(Enum):
Expand All @@ -290,6 +303,8 @@ class ServiceType(Enum):
usps_priority_mail_express = "PRIORITY EXPRESS"
usps_priority_mail_cubic = "PRIORITY MAIL CUBIC"
usps_parcel_select_ground = "PARCEL SELECT GROUND"
usps_ground_advantage = "GROUND ADVANTAGE"
usps_ground_advantage_cubic = "GROUND ADVANTAGE CUBIC"

""" ShipmentService type correspondence """
usps_first_class_mail_large_envelope = usps_first_class
Expand Down