[BUG] Payment customization function input after refresh

In some cases, when a user refreshes the checkout page, the input passed to the payment customization function contains a deliveryGroups object with a null deliveryAddress, even though the checkout form on the page is already populated with the user’s address and country.

Example of Incorrect Input

"deliveryGroups": [
  {
    "deliveryAddress": null
  }
]

Expected Behavior

When the checkout page is refreshed and the checkout form shows a populated delivery address and country, the payment customization function should receive a fully populated deliveryAddress object in deliveryGroups.

Actual Behavior

After refreshing the checkout page, the payment customization function intermittently receives deliveryAddress: null, despite the UI showing a valid address.

Steps to Reproduce

  1. Proceed to the checkout page.

  2. Enter a valid delivery address (including country).

  3. Refresh the checkout page.

  4. Observe function logs on the input passed to the payment customization function.

Frequency

Intermittent. Most commonly occurs for new customers. After the issue occurs once, it typically does not resurface for the same checkout session until the checkout is reset (e.g., starting a new checkout or clearing session state).

Impact

  • Payment customization logic that depends on delivery address or country may behave incorrectly.

  • Can result in incorrect payment methods being shown or hidden.

  • Creates inconsistency between checkout UI state and backend function input.

Additional Notes

  • The issue appears related to checkout state rehydration after a page refresh.

  • UI state and function input appear temporarily out of sync.