Skip to content

fix: carry buyer from checkout_obj in update_checkout_session#25

Open
donbenny0 wants to merge 2 commits intoUniversal-Commerce-Protocol:mainfrom
donbenny0:fix/update-checkout-buyer-fallback
Open

fix: carry buyer from checkout_obj in update_checkout_session#25
donbenny0 wants to merge 2 commits intoUniversal-Commerce-Protocol:mainfrom
donbenny0:fix/update-checkout-buyer-fallback

Conversation

@donbenny0
Copy link

Description

update_checkout_session in conformance/integration_test_utils.py was not propagating
buyer information from the existing checkout object into the update payload. When no
explicit buyer argument is passed, the field stayed None and was stripped out by
exclude_none=True during serialisation.

This broke test_known_customer_one_address (and any future test relying on buyer-aware
server logic during an update), because the server received no buyer identity and could
not inject the customer's stored addresses into the fulfillment response.

Fixes: #24

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
What changed and why — quick summary for reviewers
  Before After
currency falls back to checkout_obj.currency unchanged
line_items falls back to checkout_obj.line_items unchanged
payment falls back to checkout_obj.payment unchanged
buyer always None → omitted from request falls back to checkout_obj.buyer

The one-line fix added on line 813 of integration_test_utils.py:
integration_test_utils.py
Lines 812-813

currency = currency if currency is not None else checkout_obj.currency
buyer = buyer if buyer is not None else checkout_obj.buyer

This makes buyer consistent with every other field in the method and ensures the server always receives the customer identity during updates, enabling correct address injection for known customers.

…s.py` does not carry the

buyer information from the current checkout object into the update payload when no explicit
`buyer` argument is provided. As a result, the PUT request is sent without a `buyer` field,
which prevents the server from identifying the customer and injecting their stored addresses.
@donbenny0 donbenny0 requested a review from a team as a code owner February 27, 2026 08:55
@google-cla
Copy link

google-cla bot commented Feb 27, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@donbenny0
Copy link
Author

I signed the CLA

@donbenny0 donbenny0 changed the title fix: carry buyer from checkout_obj in update_checkout_session fix: carry buyer from checkout_obj in update_checkout_session Feb 27, 2026
@donbenny0 donbenny0 closed this Feb 27, 2026
@donbenny0 donbenny0 reopened this Feb 27, 2026
@donbenny0 donbenny0 closed this Feb 27, 2026
@donbenny0
Copy link
Author

I signed the CLA

@donbenny0 donbenny0 reopened this Feb 27, 2026
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.

[Bug]: IntegrationTestBase.update_checkout_session drops buyer identity, breaking known-customer address injection

1 participant