Repository navigation
fix(checkout): stamp the contact email on the cart's existing addresses (EDW2-215) - #4
Merged
alecritson merged 3 commits intoOct 20, 2026
Conversation
…es (EDW2-215) The contact step only wrote checkout_sessions.customer_email; the driver's storeContact, the one method that touches the cart rows, was never called. Addresses saved after the contact step already pick the email up (withContactEmail) and completion stamps the order (stampContactEmail), but rows saved before it stayed empty. A webhook-first payment creates the order from those rows inside the gateway's authorize(), before completion runs, so that order had no email unless the host app projected one. The controller now hands the email to the driver on both the guest and signed-in paths. The driver stamps it on the existing shipping and billing rows, replacing a previous contact-step email but keeping an email a row carries of its own (a wallet sheet's site contact). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2-215) Review follow-up on #4: the email was checked trimmed but stored as typed, so the session and the rows relied on the host's TrimStrings. Adds a signed-in frozen-session test (409, nothing stamped, no association) and a case/whitespace test for the earlier-email match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s (EDW2-215) Review follow-up: the cart had no addresses, so "nothing stamped" could not fail. It now uses an orderable cart with empty contact emails and asserts both rows stay empty; a stamp-before-gate mutation fails it. The signed-in path also passes the trimmed email to associateCustomer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alecritson
marked this pull request as ready for review
October 20, 2026 09:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For EDW2-215 (Edwardes security audit follow-up, found during the EDW2-201 review).
Why
The contact step (
CheckoutController::storeContact) wrote the email tocheckout_sessions.customer_emailonly. It never called the driver'sstoreContact, which is the one method that touches the cart's address rows.PR #2 already covered two of the three paths:
withContactEmail();stampContactEmail().The gap left: rows saved before the contact step stayed empty. A webhook-first Stripe payment creates the order from those rows inside the gateway's
authorize(), before completion runs. That order had no customer email unless the host app projected one; Edwardes does this with its ownProjectContactEmailpipeline step.What
storeContactnow hands the email to the driver on both the guest and signed-in paths. The signed-in path still associates the customer afterwards.storeContactstamps the email on the existing shipping and billing rows. It creates no rows.withContactEmail()already uses.ensureWritable, and the driver usesoperableCart(409 frozen / 410 gone).CheckoutSessionResynced;Tests
tests/Feature/GuestContactEmailTest:The first five fail against
main.ContactInformationTestadds a signed-in frozen-session test: 409, nothing stamped, no association. The full suite passes on SQLite (315). The contact, pay boundary and webhook-first files also pass on MySQL. PHPStan and Pint are clean.🤖 Generated with Claude Code