Skip to content

fix: use checkout line item ids in order fulfillment tests - #81

Merged
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/use-order-line-item-ids
Aug 12, 2026
Merged

fix: use checkout line item ids in order fulfillment tests#81
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/use-order-line-item-ids

Conversation

@FanouZeng-TT

Copy link
Copy Markdown
Contributor

Description

order_test.py copied the real checkout line items into the update payload:

"line_items": [
  {
    "item": {"id": li.item.id, "title": li.item.title},
    "quantity": li.quantity,
    "id": li.id,
  }
  for li in checkout_obj.line_items
]

The fulfillment method in the same payload still used a fixture-specific fallback:

"line_item_ids": ["item_123"]

That value does not come from the checkout response, so a merchant implementation with different line item IDs can receive a fulfillment selection that references no line item in the current checkout.

Fix: use checkout_obj.line_items[0].id for the fulfillment method and group fallback IDs, matching the line items already sent in the same request.

Category (Required)

  • Core Protocol: Changes to the core UCP specification. (Requires Technical Council approval)
  • Governance/Contributing: Changes to governance or contributing processes. (Requires Governance Council approval)
  • Capability: Changes to a UCP capability. (Requires Maintainer approval)
  • Documentation: Documentation-only changes. (Requires Maintainer approval)
  • Infrastructure: CI/CD or repository infrastructure changes. (Requires DevOps Maintainer approval)
  • Maintenance: Dependency or repository maintenance. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool. (Requires Maintainer approval)
  • Community Health (.github): Changes to organization community health files. (Requires DevOps Maintainer approval)

Related Issues

N/A

Checklist

  • I have followed the Contributing Guide and Code of Conduct.
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective.
  • New and existing unit tests pass locally with my changes.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk (not applicable).

Screenshots / Logs (if applicable)

  • uv run python order_test.py --server_url=http://localhost:8182 --simulation_secret=super-secret-sim-key --test_data_dir=test_data/flower_shop: 4 passed
  • pre-commit run --all-files: passed
  • git diff --check: passed

@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Aug 12, 2026
@damaz91
damaz91 merged commit eeb200b into Universal-Commerce-Protocol:main Aug 12, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants