Skip to content

fix: Update python server /samples to UCP 01-23 version.#66

Open
cusell-google wants to merge 10 commits intoUniversal-Commerce-Protocol:mainfrom
cusell-google:main
Open

fix: Update python server /samples to UCP 01-23 version.#66
cusell-google wants to merge 10 commits intoUniversal-Commerce-Protocol:mainfrom
cusell-google:main

Conversation

@cusell-google
Copy link
Copy Markdown

Update python server /samples to UCP 01-23 version.

payment_data=payment_instrument.PaymentInstrument(root=instrument),
risk_signals={},
)
return {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain the rationale?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client post (lines 306-310) require the direct json object or a dictionary. They don't serialize pydantic models, so if we the method returns a class here it would need to be converted or unpacked with "model_dump" like it was before. This is cleaner as it avoids the double conversion.

@cusell-google cusell-google changed the title Update python server /samples to UCP 01-23 version. test: Update python server /samples to UCP 01-23 version. Mar 24, 2026
@cusell-google cusell-google changed the title test: Update python server /samples to UCP 01-23 version. fix: Update python server /samples to UCP 01-23 version. Mar 25, 2026
"ip": "127.0.0.1",
"browser": "python-httpx",
final_payload = {
"payment_data": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not seem a v23 payload. i'd expect "payment", not "payment_data"

"endpoint": "{{ENDPOINT}}"
"dev.ucp.shopping": [
{
"version": "2026-01-11",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update to 2026-01-23?

from ucp_sdk.models.schemas.ucp import Version
from ucp_sdk.models.schemas.capability import ResponseSchema as Response
from ucp_sdk.models.schemas.shopping.ap2_mandate import (
Checkout as Ap2CompleteRequest,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems suspicious

risk_signals={},
)
return {
"payment_data": payment_instrument.PaymentInstrument(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use a native object, not a json

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the reply to your other comment one line above. It's for testing the post payload and it would need to be converted anyway.

rordd pushed a commit to rordd/lisa-ucp-samples that referenced this pull request Apr 3, 2026
…mmerce-Protocol#66

Merged Universal-Commerce-Protocol/samples PR Universal-Commerce-Protocol#66 to fix SDK v0.3.0
compatibility (naming convention change). Kept local SDK path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants