fix: Update python server /samples to UCP 01-23 version.#66
fix: Update python server /samples to UCP 01-23 version.#66cusell-google wants to merge 10 commits intoUniversal-Commerce-Protocol:mainfrom
Conversation
| payment_data=payment_instrument.PaymentInstrument(root=instrument), | ||
| risk_signals={}, | ||
| ) | ||
| return { |
There was a problem hiding this comment.
can you explain the rationale?
There was a problem hiding this comment.
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.
…json for payment payload
| "ip": "127.0.0.1", | ||
| "browser": "python-httpx", | ||
| final_payload = { | ||
| "payment_data": { |
There was a problem hiding this comment.
this does not seem a v23 payload. i'd expect "payment", not "payment_data"
| "endpoint": "{{ENDPOINT}}" | ||
| "dev.ucp.shopping": [ | ||
| { | ||
| "version": "2026-01-11", |
| 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, |
| risk_signals={}, | ||
| ) | ||
| return { | ||
| "payment_data": payment_instrument.PaymentInstrument( |
There was a problem hiding this comment.
should use a native object, not a json
There was a problem hiding this comment.
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.
…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.
Update python server /samples to UCP 01-23 version.