Feat/64 social session checkout#76
Open
WilliamH141 wants to merge 4 commits into
Open
Conversation
b8d12a3 to
fbaff4d
Compare
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.
Description
Adds
POST /api/social-sessions/:id/checkout, creates a pending registration + Stripe Checkout Session for paid social sessions. Cleans up the pending row if Stripe fails. AddsstripeCheckoutSessionIdtoSocialSessionRegistrations.Closes #64
Type of change
How Has This Been Tested?
Tested manually, see breakdown below.
Setup:
.envmonday social session, memberPrice 14, nonMemberPrice 3)Test 1: Happy path (guest checkout)
Response:
{ url, registrationId: 6a1ce3547bf243fea37ba4e4 }Stripe Checkout rendered with NZ$3.00 (non-member price) +
guest@example.compre-filled:Payload row created with
paymentStatus: pending,amountPaid: 3,stripeCheckoutSessionIdpopulated:Test 2: Free session rejected
Created a free session (no memberPrice / nonMemberPrice), then ran:
Response:
{"error":"This session is free — register directly without checkout."}No new registration row created (4 rows, all for
monday social session):Test 3: Stripe failure cleans up
Temporarily set
STRIPE_SECRET_KEY=sk_test_bogusin.env, restarted dev, then ran:Response:
{"error":"Failed to create checkout session"}No leftover pending row for
Test Guest 2, cleanup logic deleted it after Stripe failed:Checklist before requesting a review