Skip to content

fix(storefront): capture the checkout id and payment intent from Before - #48

Merged
roncodes merged 1 commit into
mainfrom
fix/storefront-checkout-captures
Aug 13, 2026
Merged

fix(storefront): capture the checkout id and payment intent from Before#48
roncodes merged 1 commit into
mainfrom
fix/storefront-checkout-captures

Conversation

@roncodes

Copy link
Copy Markdown
Member

Before is the only request that returns them, and nothing was capturing either — so two requests were sent literal unresolved variables:

request sent answered
Get Checkout Status ?checkout={{checkout_id}} 404 Checkout not found
Update Stripe Payment Intent payment_intent_id: "{{payment_intent_id}}" 400 No such payment_intent: '{{payment_intent_id}}'

The id is not the token

{{checkout_id}} is the chkt_* public id, not the checkout_* token. /checkouts/status matches on both:

Checkout::where('public_id', $checkoutId)->where('token', $token)->first()

Capturing the token into checkout_id would 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 checkout to 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_id and checkout_token are all sourced now.

🤖 Generated with Claude Code

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>
@roncodes
roncodes merged commit e6a49b7 into main Aug 13, 2026
1 check passed
@roncodes
roncodes deleted the fix/storefront-checkout-captures branch August 13, 2026 16:46
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.

1 participant