Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds optional return_url handling end-to-end: backend create-purchase-url and validate-code accept/validate return_url, clients and shared APIs propagate it, dashboard/checkout flows include it in Stripe return links and in-tab navigation, tests added/updated, and server customer checkout helper centralized. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as Dashboard UI
participant Client as Stack Client
participant Backend as Backend API
participant Stripe as Stripe
participant Return as /purchase/return
UI->>Client: createCheckoutUrl(productId, returnUrl?)
Client->>Backend: POST /payments/purchases/create-purchase-url { productId, return_url? }
Backend-->>Client: 200 { purchaseUrl (includes ?return_url=...) }
Client-->>UI: purchaseUrl
UI->>UI: window.location.assign(purchaseUrl) %% in-tab navigation
UI->>Stripe: confirmPayment(..., return_url: /purchase/return?code=...&return_url=...)
Stripe-->>Return: Redirect to /purchase/return?code=...&return_url=...
Return->>Backend: GET /payments/purchases/validate-code?full_code=...&return_url=...
Backend-->>Return: 200 { valid: true } or 400 (REDIRECT_URL_NOT_WHITELISTED)
alt valid & return_url trusted
Return-->>UI: Redirect to provided return_url
else invalid return_url
Return-->>UI: Show error (cannot redirect)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ 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 |
There was a problem hiding this comment.
Greptile Overview
Summary
This PR implements comprehensive support for custom redirect URLs in the Stack Auth payments system. The changes add an optional `returnUrl` parameter throughout the payment flow, allowing applications to specify where users should be redirected after completing a purchase. The implementation spans the entire payment lifecycle:-
Client Interface Extensions: Added
returnUrlparameter to checkout URL creation methods in both client and server implementations, maintaining backward compatibility through optional typing. -
Backend API Enhancement: The
/payments/purchases/create-purchase-urlendpoint now accepts and validates areturn_urlparameter, which gets appended to the generated purchase URL as a query parameter. -
Payment Flow Integration: The purchase pages extract the return URL from query parameters and pass it through the payment components. The CheckoutForm component embeds the return URL in the Stripe return URL configuration.
-
Post-Payment Redirect Logic: The payment return page now automatically redirects users to the specified return URL after successful payment or when bypassing in test mode, with appropriate user messaging.
-
Dashboard Integration: The team upgrade flow in the dashboard now uses the new return URL functionality to redirect users back to their original location after completing checkout.
The implementation follows existing patterns in the codebase and includes comprehensive test coverage. It enhances user experience by eliminating the need for users to manually navigate back to their original context after payment completion.
PR Description Notes:
- The PR description is empty except for the contributing guidelines comment
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts |
4/5 | Adds optional return_url parameter validation and query parameter appending to purchase URLs |
packages/stack-shared/src/interface/client-interface.ts |
3/5 | Adds optional returnUrl parameter to createCheckoutUrl method but may send undefined values to API |
packages/template/src/lib/stack-app/customers/index.ts |
5/5 | Type definition changes adding optional returnUrl parameter to checkout options |
packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts |
5/5 | Simple parameter passthrough for returnUrl in client implementation |
packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts |
4/5 | Refactors duplicate code into shared method while adding returnUrl support |
apps/dashboard/src/components/payments/checkout.tsx |
4/5 | Integrates returnUrl parameter into Stripe checkout configuration |
apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx |
4/5 | Extracts and passes return URL through payment flow components |
apps/dashboard/src/app/(main)/purchase/return/page-client.tsx |
4/5 | Implements automatic redirect logic using extracted return URL |
apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/projects/page-client.tsx |
4/5 | Updates team upgrade flow to use return URL and current window navigation |
apps/backend/src/route-handlers/smart-response.tsx |
5/5 | Type alignment change from ArrayBuffer to BodyInit for broader binary response support |
apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts |
4/5 | Adds test coverage for return_url parameter in API endpoint |
apps/e2e/tests/js/payments.test.ts |
4/5 | Adds test for checkout URL generation with return URL parameter |
Confidence score: 4/5
- This PR is generally safe to merge with well-structured changes following established patterns
- Score reflects comprehensive implementation with good test coverage, though some minor type safety concerns exist
- Pay close attention to
packages/stack-shared/src/interface/client-interface.tsfor potential undefined value handling
Sequence Diagram
sequenceDiagram
participant User
participant Frontend
participant Backend
participant Stripe
participant Database
User->>Frontend: "Click create checkout button"
Frontend->>Backend: "POST /payments/purchases/create-purchase-url"
note over Frontend,Backend: "{ customer_type, customer_id, offer_id, return_url }"
Backend->>Backend: "Validate offer configuration"
Backend->>Stripe: "Search for existing customer"
alt Customer doesn't exist
Backend->>Stripe: "Create new customer"
end
Backend->>Database: "Create verification code"
Backend->>Backend: "Generate purchase URL with code"
Backend-->>Frontend: "{ url: 'https://dashboard/purchase/{code}?return_url=...' }"
Frontend->>Frontend: "Redirect to purchase URL"
User->>Frontend: "Visit purchase page"
Frontend->>Backend: "POST /payments/purchases/validate-code"
Backend->>Database: "Validate purchase code"
Backend-->>Frontend: "Offer details and Stripe account info"
User->>Frontend: "Select price and quantity"
User->>Frontend: "Click submit payment"
Frontend->>Backend: "POST /payments/purchases/purchase-session"
Backend->>Stripe: "Create payment session"
Backend-->>Frontend: "{ client_secret }"
Frontend->>Stripe: "Process payment with client_secret"
Stripe-->>Frontend: "Payment result"
Frontend->>Frontend: "Redirect to return page"
alt Payment successful and return_url provided
Frontend->>Frontend: "Redirect to return_url"
else Payment successful, no return_url
Frontend->>Frontend: "Show success message"
end
12 files reviewed, 3 comments
packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 69fb515..5d7547f
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (5)
• packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts
• apps/dashboard/src/app/(main)/purchase/return/page-client.tsx
• apps/dashboard/src/components/payments/checkout.tsx
• apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx
• apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/projects/page-client.tsx
⏭️ Files skipped (7)
| Locations |
|---|
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts |
apps/backend/src/route-handlers/smart-response.tsx |
apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts |
apps/e2e/tests/js/payments.test.ts |
packages/stack-shared/src/interface/client-interface.ts |
packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts |
packages/template/src/lib/stack-app/customers/index.ts |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/dashboard/src/app/(main)/purchase/return/page-client.tsx (1)
35-57: Harden returnUrl redirects againstjavascript:URIs
window.location.assign(returnUrl)is now reached on both the bypass and success paths. Because the query param is attacker-controlled, values such asjavascript:alert(1)will execute immediately, yielding an XSS on the purchase return page. Please normalise and vet the value (e.g. parse withnew URL(..., window.location.origin)and only honourhttp:/https:schemes) before using it, and skip the redirect if it fails validation.Example fix:
- const returnUrl = searchParams.get("return_url"); + const rawReturnUrl = searchParams.get("return_url"); + const safeReturnUrl = (() => { + if (!rawReturnUrl) return null; + try { + const parsed = new URL(rawReturnUrl, window.location.href); + return ["http:", "https:"].includes(parsed.protocol) ? parsed.toString() : null; + } catch { + return null; + } + })();and then guard both
window.location.assign(...)calls behindif (safeReturnUrl).
🧹 Nitpick comments (1)
packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts (1)
196-215: Recommend improving type safety for returnUrl access.The helper successfully centralizes customer-related logic and reduces duplication. However, line 212 uses
(options as any).returnUrlto access thereturnUrlproperty, which bypasses type checking.Consider extracting
returnUrlexplicitly to avoid theanycast:- async createCheckoutUrl(options: { offerId: string, returnUrl?: string } | { offer: InlineOffer, returnUrl?: string }) { + async createCheckoutUrl(options: { offerId: string, returnUrl?: string } | { offer: InlineOffer, returnUrl?: string }) { const offerIdOrInline = "offerId" in options ? options.offerId : options.offer; - return await app._interface.createCheckoutUrl(type, userIdOrTeamId, offerIdOrInline, null, (options as any).returnUrl); + const returnUrl = "returnUrl" in options ? options.returnUrl : undefined; + return await app._interface.createCheckoutUrl(type, userIdOrTeamId, offerIdOrInline, null, returnUrl); },This makes the code more explicit and type-safe.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts(2 hunks)apps/backend/src/route-handlers/smart-response.tsx(1 hunks)apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/projects/page-client.tsx(1 hunks)apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx(4 hunks)apps/dashboard/src/app/(main)/purchase/return/page-client.tsx(4 hunks)apps/dashboard/src/components/payments/checkout.tsx(2 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts(2 hunks)apps/e2e/tests/js/payments.test.ts(1 hunks)packages/stack-shared/src/interface/client-interface.ts(2 hunks)packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts(1 hunks)packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts(4 hunks)packages/template/src/lib/stack-app/customers/index.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
{apps/dashboard,apps/dev-launchpad,packages/stack-ui,packages/react}/**/*.{tsx,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
For blocking alerts and errors in UI, do not use toast notifications; use alerts instead
Files:
apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/projects/page-client.tsxapps/dashboard/src/components/payments/checkout.tsxapps/dashboard/src/app/(main)/purchase/return/page-client.tsxapps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Prefer ES6 Map over Record when representing key–value collections
Files:
apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/projects/page-client.tsxapps/e2e/tests/js/payments.test.tsapps/dashboard/src/components/payments/checkout.tsxapps/backend/src/route-handlers/smart-response.tsxapps/dashboard/src/app/(main)/purchase/return/page-client.tsxapps/dashboard/src/app/(main)/purchase/[code]/page-client.tsxpackages/stack-shared/src/interface/client-interface.tspackages/template/src/lib/stack-app/apps/implementations/server-app-impl.tsapps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.tspackages/template/src/lib/stack-app/apps/implementations/client-app-impl.tspackages/template/src/lib/stack-app/customers/index.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts
{apps/dashboard,apps/dev-launchpad,packages/stack-ui,packages/react}/**/*.{tsx,jsx,css}
📄 CodeRabbit inference engine (AGENTS.md)
Keep hover/click animations snappy; avoid pre-transition delays on hover and apply transitions after the action (e.g., fade-out on hover end)
Files:
apps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/projects/page-client.tsxapps/dashboard/src/components/payments/checkout.tsxapps/dashboard/src/app/(main)/purchase/return/page-client.tsxapps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx
**/*.test.{ts,tsx,js}
📄 CodeRabbit inference engine (AGENTS.md)
In tests, prefer .toMatchInlineSnapshot where possible; refer to snapshot-serializer.ts for snapshot formatting and handling of non-deterministic values
Files:
apps/e2e/tests/js/payments.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts
packages/template/**
📄 CodeRabbit inference engine (AGENTS.md)
When modifying the SDK copies, make changes in packages/template (source of truth)
Files:
packages/template/src/lib/stack-app/apps/implementations/server-app-impl.tspackages/template/src/lib/stack-app/apps/implementations/client-app-impl.tspackages/template/src/lib/stack-app/customers/index.ts
apps/backend/src/app/api/latest/**
📄 CodeRabbit inference engine (AGENTS.md)
apps/backend/src/app/api/latest/**: Organize backend API routes by resource under /api/latest (e.g., auth at /api/latest/auth/, users at /api/latest/users/, teams at /api/latest/teams/, oauth providers at /api/latest/oauth-providers/)
Use the custom route handler system in the backend to ensure consistent API responses
Files:
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts
🧬 Code graph analysis (3)
apps/e2e/tests/js/payments.test.ts (2)
apps/e2e/tests/helpers.ts (1)
it(11-11)apps/e2e/tests/js/js-helpers.ts (1)
createApp(41-86)
packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts (2)
packages/template/src/lib/stack-app/customers/index.ts (2)
Customer(35-49)InlineOffer(5-5)packages/template/src/lib/stack-app/apps/implementations/common.ts (1)
useAsyncCache(146-191)
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts (1)
packages/stack-shared/src/schema-fields.ts (1)
yupString(187-190)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: sync
- GitHub Check: Vercel Agent Review
- GitHub Check: setup-tests
- GitHub Check: build (22.x)
- GitHub Check: build (22.x)
- GitHub Check: lint_and_build (latest)
- GitHub Check: docker
- GitHub Check: docker
- GitHub Check: all-good
- GitHub Check: Security Check
🔇 Additional comments (10)
apps/dashboard/src/components/payments/checkout.tsx (2)
24-28: LGTM!The optional
returnUrlprop is correctly typed and integrated into the component signature.
43-48: Verify returnUrl is properly validated upstream
ThereturnUrlquery parameter is appended directly to the Stripe return URL, which can enable open‐redirect attacks. Confirm thatreturnUrlis validated or restricted (e.g., against a whitelist of allowed origins) before being used here.apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx (4)
13-13: LGTM!Correctly imports
useSearchParamsfrom Next.js navigation to read query parameters.
37-37: LGTM!Correctly extracts the
return_urlquery parameter. The value will bestring | null, which is appropriately handled downstream.
144-148: Correctly propagates returnUrl to bypass flow.The bypass URL construction correctly includes the
return_urlparameter when present, and the dependency array is properly updated to includereturnUrl. However, ensure the same validation concerns noted in the checkout component are addressed.
290-290: LGTM!Correctly converts
nulltoundefinedand passesreturnUrltoCheckoutForm.packages/template/src/lib/stack-app/customers/index.ts (1)
40-41: LGTM!The type signature correctly adds the optional
returnUrlparameter to both theofferIdbranch and the server-onlyInlineOfferbranch, maintaining backward compatibility.packages/template/src/lib/stack-app/apps/implementations/server-app-impl.ts (3)
27-27: LGTM!Correctly imports
Customertype to support the new helper's return type signature.
677-677: LGTM!Successfully refactored to use the centralized
_createServerCustomerhelper, reducing code duplication while maintaining the same functionality.
793-793: LGTM!Successfully refactored to use the centralized
_createServerCustomerhelper for team customers, consistent with the user implementation.
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts
Outdated
Show resolved
Hide resolved
|
Some new issue(s) might be present. Please use the following link(s) to view them: Additionally, the following low severity issue(s) were found: https://zeropath.com/app/issues/220cd9dd-def4-4d52-a5a9-91a7e5738fbd Reply to this PR with |
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts(3 hunks)apps/backend/src/app/api/latest/payments/purchases/validate-code/route.ts(4 hunks)apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx(6 hunks)apps/dashboard/src/app/(main)/purchase/return/page-client.tsx(4 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts(2 hunks)apps/e2e/tests/backend/endpoints/api/v1/payments/validate-code.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.test.{ts,tsx,js}
📄 CodeRabbit inference engine (AGENTS.md)
In tests, prefer .toMatchInlineSnapshot where possible; refer to snapshot-serializer.ts for snapshot formatting and handling of non-deterministic values
Files:
apps/e2e/tests/backend/endpoints/api/v1/payments/validate-code.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Prefer ES6 Map over Record when representing key–value collections
Files:
apps/e2e/tests/backend/endpoints/api/v1/payments/validate-code.test.tsapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/dashboard/src/app/(main)/purchase/return/page-client.tsxapps/backend/src/app/api/latest/payments/purchases/validate-code/route.tsapps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx
{apps/dashboard,apps/dev-launchpad,packages/stack-ui,packages/react}/**/*.{tsx,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
For blocking alerts and errors in UI, do not use toast notifications; use alerts instead
Files:
apps/dashboard/src/app/(main)/purchase/return/page-client.tsxapps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx
{apps/dashboard,apps/dev-launchpad,packages/stack-ui,packages/react}/**/*.{tsx,jsx,css}
📄 CodeRabbit inference engine (AGENTS.md)
Keep hover/click animations snappy; avoid pre-transition delays on hover and apply transitions after the action (e.g., fade-out on hover end)
Files:
apps/dashboard/src/app/(main)/purchase/return/page-client.tsxapps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx
apps/backend/src/app/api/latest/**
📄 CodeRabbit inference engine (AGENTS.md)
apps/backend/src/app/api/latest/**: Organize backend API routes by resource under /api/latest (e.g., auth at /api/latest/auth/, users at /api/latest/users/, teams at /api/latest/teams/, oauth providers at /api/latest/oauth-providers/)
Use the custom route handler system in the backend to ensure consistent API responses
Files:
apps/backend/src/app/api/latest/payments/purchases/validate-code/route.ts
🧬 Code graph analysis (5)
apps/e2e/tests/backend/endpoints/api/v1/payments/validate-code.test.ts (1)
apps/e2e/tests/backend/backend-helpers.ts (1)
niceBackendFetch(107-171)
apps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.ts (2)
apps/e2e/tests/helpers.ts (1)
it(11-11)apps/e2e/tests/backend/backend-helpers.ts (1)
niceBackendFetch(107-171)
apps/dashboard/src/app/(main)/purchase/return/page-client.tsx (3)
apps/dashboard/src/lib/env.tsx (1)
getPublicEnvVar(49-59)packages/stack-shared/src/utils/errors.tsx (1)
throwErr(10-19)packages/stack-shared/src/utils/promises.tsx (1)
runAsynchronously(343-366)
apps/backend/src/app/api/latest/payments/purchases/validate-code/route.ts (4)
packages/stack-shared/src/schema-fields.ts (2)
urlSchema(334-342)yupString(187-190)apps/backend/src/lib/redirect-urls.tsx (1)
validateRedirectUrl(69-85)packages/stack-shared/src/known-errors.tsx (2)
KnownErrors(1570-1572)KnownErrors(1574-1696)apps/backend/src/lib/tenancies.tsx (1)
getTenancy(68-77)
apps/dashboard/src/app/(main)/purchase/[code]/page-client.tsx (1)
packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts (1)
useUser(1558-1600)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Vercel Agent Review
- GitHub Check: build (22.x)
- GitHub Check: build (22.x)
- GitHub Check: setup-tests
- GitHub Check: docker
- GitHub Check: docker
- GitHub Check: all-good
- GitHub Check: lint_and_build (latest)
- GitHub Check: restart-dev-and-test
- GitHub Check: Security Check
High-level PR Summary
This PR adds support for an optional
returnUrlparameter to the payments flow, allowing users to be redirected back to a specific URL after completing or bypassing a purchase. The feature is implemented across the full stack: the API endpoint now acceptsreturn_url, the SDK methods (createCheckoutUrl) accept an optionalreturnUrlparameter for both client and server implementations, and the dashboard purchase flow propagates this URL through the checkout and return pages to perform the final redirect. The change also improves the user experience when adding dashboard admins by redirecting back to the original page after payment.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
packages/template/src/lib/stack-app/customers/index.tspackages/stack-shared/src/interface/client-interface.tsapps/backend/src/app/api/latest/payments/purchases/create-purchase-url/route.tspackages/template/src/lib/stack-app/apps/implementations/client-app-impl.tspackages/template/src/lib/stack-app/apps/implementations/server-app-impl.tsapps/dashboard/src/components/payments/checkout.tsxapps/dashboard/src/app/(main)/purchase/[code]/page-client.tsxapps/dashboard/src/app/(main)/purchase/return/page-client.tsxapps/dashboard/src/app/(main)/(protected)/(outside-dashboard)/projects/page-client.tsxapps/e2e/tests/backend/endpoints/api/v1/payments/create-purchase-url.test.tsapps/e2e/tests/js/payments.test.tsapps/backend/src/route-handlers/smart-response.tsxapps/backend/src/route-handlers/smart-response.tsxImportant
Add optional
returnUrlparameter to payment flow, updating API, SDK, and dashboard to handle post-purchase redirects.returnUrlparameter to payment flow increate-purchase-url/route.tsandvalidate-code/route.ts.CheckoutFormincheckout.tsxto handlereturnUrl.returnUrlis provided.server-app-impl.ts.create-purchase-url.test.tsandvalidate-code.test.tsforreturnUrlhandling and validation.payments.test.tsto verifyreturnUrlembedding in checkout URL.This description was created by
for 259529b. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
New Features
Refactor
Tests