Checkout: Remove siteId check from stored card prepurchase validation #48632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request
A siteId is indeed required by the transaction endpoint; however for siteless checkout the corresponding
no-site
id value and related properties likecreate_new_site
are added increateTransactionEndpointRequestPayloadFromLineItems
, after this validation check happens.With this check in place, when the siteId is not set we throw an error before getting to the code that cleans up the transaction payload. Removing this check has no effect on purchases with a site ID, and allows siteless purchases to proceed.
I think this regression was added in #48069 (which I reviewed 😬), and I missed it at the time because I didn't test it with the siteless flow. It is hard to keep track of which flows can be affected by what changes!
Testing instructions
We need to check two things: (1) that siteless purchases with a stored card succeed or fail as expected, and (2) that non-siteless (siteful?) purchases with a stored card are not affected.
/domains
, choose a domain, and when prompted to select a plan opt for "Just a domain". Once in checkout, verify that you can complete the purchase with a stored card.