feat(paykit): harden subscription checkout sessions#202
Conversation
|
@Pascoooo is attempting to deploy a commit to the maxktz Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
This PR hardens subscription Checkout Sessions without adding app-specific billing behavior.
It is stacked on #201 (
subscription-quantity). After #201 merges, this branch should be rebased so this PR contains only the checkout hardening commit.Changes
checkoutSessionIdfrom subscription checkout results.expireCheckoutSessionPayKit method that verifies provider customer ownership before expiring a Stripe Checkout Session.paykitjsrelease.Out of scope
Verification
pnpm --filter paykitjs typecheckpnpm lintpnpm test:unitpnpm --filter paykitjs buildpnpm exec oxfmt --check <touched files>Note:
pnpm format:checkcurrently fails on this Windows shell because the quoted glob is not expanded foroxfmt, so touched files were checked explicitly instead.Summary by cubic
Hardens subscription Checkout Sessions and adds quantity-aware subscriptions across
paykitjs. Adds a secure server method to expire Stripe sessions, returnscheckoutSessionIdfrom subscribe, and avoids top‑level eval during runtime init.New Features
expireCheckoutSessionthat verifies customer ownership, treats already-expired sessions as idempotent, and expires only open sessions.subscribenow returnscheckoutSessionIdand supportsquantity; quantity is persisted and synced across create/update/schedule flows.Migration
expireCheckoutSession; addquantitytocreateSubscription,updateSubscription,scheduleSubscriptionChange, andcreateSubscriptionCheckout; includequantityin returned subscriptions.subscribeacceptscheckoutandquantity; handlecheckoutSessionIdin the result.Written for commit 0dc710c. Summary will update on new commits.