Skip to content
Open
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
20 changes: 12 additions & 8 deletions checkout_lifecycle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
)
from ucp_sdk.models.schemas.shopping.types import item_update_request
from ucp_sdk.models.schemas.shopping.types import line_item_update_request
from ucp_sdk.models.schemas.shopping.types import shipping_destination
from ucp_sdk.models.schemas.shopping.types import (
shipping_destination_update_request,
)

# Rebuild models to resolve forward references
checkout.Checkout.model_rebuild(_types_namespace={"Payment": Payment})
Expand Down Expand Up @@ -126,13 +128,15 @@ def test_update_checkout(self):
phone_number="+15555555556",
)

new_destination = shipping_destination.ShippingDestination(
id="dest_2",
address_country="US",
postal_code="90210",
locality="Beverly Hills",
region="CA",
street_address="456 Elm St",
new_destination = (
shipping_destination_update_request.ShippingDestinationUpdateRequest(
id="dest_2",
address_country="US",
postal_code="90210",
address_locality="Beverly Hills",
address_region="CA",
street_address="456 Elm St",
)
)

existing_method = checkout_obj.fulfillment["methods"][0]
Expand Down
26 changes: 16 additions & 10 deletions integration_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
from ucp_sdk.models.schemas.shopping.types import line_item_create_request
from ucp_sdk.models.schemas.shopping.types import line_item_update_request
from ucp_sdk.models.schemas import payment_handler
from ucp_sdk.models.schemas.shopping.types import shipping_destination
from ucp_sdk.models.schemas.shopping.types import (
shipping_destination_create_request,
)
import uvicorn


Expand Down Expand Up @@ -889,15 +891,19 @@ def create_checkout_payload(
if include_fulfillment:
# Hierarchical Fulfillment Construction using dynamic destination
dest_data = ctx.get_test_destination()
destination = shipping_destination.ShippingDestination(
id="dest_1",
address_country=dest_data.get(
"address_country", dest_data.get("country", "US")
),
postal_code=dest_data.get("postal_code", "94105"),
locality=dest_data.get("locality", dest_data.get("city")),
region=dest_data.get("region", dest_data.get("state")),
street_address=dest_data.get("street_address", dest_data.get("street")),
destination = (
shipping_destination_create_request.ShippingDestinationCreateRequest(
id="dest_1",
address_country=dest_data.get(
"address_country", dest_data.get("country", "US")
),
postal_code=dest_data.get("postal_code", "94105"),
address_locality=dest_data.get("locality", dest_data.get("city")),
address_region=dest_data.get("region", dest_data.get("state")),
street_address=dest_data.get(
"street_address", dest_data.get("street")
),
)
)
group = fulfillment_group_create_request.FulfillmentGroupCreateRequest(
id="group_1",
Expand Down
Loading