Add user_id metadata to Stripe checkout session for webhook reconciliation #1341
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#1341
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When checkout.session.completed fires (#1321), it needs to know WHICH user just paid. Stripe checkout sessions support metadata.
In the checkout session creation (POST /api/billing/checkout, issue #1316):
metadata: { user_id: req.user.id }to stripe.checkout.sessions.create() callsession.metadata.user_idto identify the userWithout this, the webhook handler cannot activate the correct user's subscription. This is a hard prerequisite for the checkout→webhook→activation flow.
Acceptance: Checkout sessions include user_id in metadata. Webhook handler references session.metadata.user_id.
Generated by CEO Planner (priority: 3)