fix(storefront): capture the checkout id and payment intent from Before - #48
Merged
Conversation
Before is the only request that returns them, and nothing was capturing either, so
two requests were sent literal unresolved variables:
Get Checkout Status ?checkout={{checkout_id}} -> 404 "Checkout not found"
Update Stripe Payment Intent payment_intent_id -> 400 "No such payment_intent:
'{{payment_intent_id}}'"
{{checkout_id}} is the chkt_* public id, NOT the checkout_* token — /checkouts/status
matches on both and they are different values. Capturing the token into it would look
right and still 404.
The id only became available on the card path in fleetbase/storefront@dev-v0.4.19,
which adds `checkout` to the three initialization responses that returned the token
alone; the QPay path already returned it.
The payment-intent capture is guarded rather than assumed, because only the card
gateway returns one — a cash or pickup checkout answers with the ids alone.
Also unblocks the two QPay callbacks, which address {{checkout_id}} as well.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Beforeis the only request that returns them, and nothing was capturing either — so two requests were sent literal unresolved variables:Get Checkout Status?checkout={{checkout_id}}Checkout not foundUpdate Stripe Payment Intentpayment_intent_id: "{{payment_intent_id}}"No such payment_intent: '{{payment_intent_id}}'The id is not the token
{{checkout_id}}is thechkt_*public id, not thecheckout_*token./checkouts/statusmatches on both:Capturing the token into
checkout_idwould look right and still 404 — worth stating because the two sit next to each other in the same response.That id only became available on the card path in storefront@dev-v0.4.19, which adds
checkoutto the three initialization responses that returned the token alone. The QPay path already returned it.Guarded, not assumed
Only the card gateway returns a payment intent — a cash or pickup checkout answers with the ids alone — so that capture is conditional rather than unconditional.
This also unblocks both QPay callbacks, which address
{{checkout_id}}too.Verified with
scripts/ci/find-unsourced-variables.py:checkout_id,payment_intent_idandcheckout_tokenare all sourced now.🤖 Generated with Claude Code