Skip to content

add createCheckout backed by recaptcha and honeypot#23

Merged
vkarpov15 merged 3 commits into
masterfrom
vkarpov15/create-checkout
Apr 4, 2026
Merged

add createCheckout backed by recaptcha and honeypot#23
vkarpov15 merged 3 commits into
masterfrom
vkarpov15/create-checkout

Conversation

@vkarpov15
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 4, 2026 21:45
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 4, 2026

Deploy Preview for mongoose-js ready!

Name Link
🔨 Latest commit d628fd4
🔍 Latest deploy log https://app.netlify.com/projects/mongoose-js/deploys/69d18844665bca0008d0461c
😎 Deploy Preview https://deploy-preview-23--mongoose-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new createCheckout server action (exposed as a Netlify function) that creates an embedded Stripe Checkout session, gated by a honeypot field and Google reCAPTCHA verification.

Changes:

  • Added a recaptcha integration to verify tokens via Google’s siteverify endpoint.
  • Added src/actions/createCheckout.js to validate input, enforce honeypot + reCAPTCHA, and create an embedded Stripe subscription checkout session.
  • Added netlify/functions/createCheckout.js wrapper to expose the action as a Netlify function.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/integrations/recaptcha.js New reCAPTCHA verification helper used to gate checkout creation.
src/actions/createCheckout.js New action implementing honeypot + reCAPTCHA checks and creating a Stripe Checkout session.
netlify/functions/createCheckout.js Netlify function entrypoint for the new action.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/actions/createCheckout.js
Comment thread src/actions/createCheckout.js
Comment thread src/actions/createCheckout.js
Comment thread src/actions/createCheckout.js
Comment thread src/integrations/recaptcha.js
Comment thread src/integrations/recaptcha.js
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 804eed1b77

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +54 to +58
const session = await stripe.client.checkout.sessions.create({
ui_mode: 'embedded',
mode: 'subscription',
customer_email: email,
line_items: [{ price: priceId, quantity: 1 }],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Set client_reference_id on checkout session

stripeWebhook can only attach a successful checkout to an existing workspace when data.object.client_reference_id is present; otherwise it always creates a new workspace. This checkout creation payload never sets client_reference_id, so any purchase initiated for an existing workspace will be processed as a brand-new workspace instead of an upgrade, leading to duplicate workspaces and the original workspace remaining unsubscribed.

Useful? React with 👍 / 👎.

@vkarpov15 vkarpov15 merged commit 76561eb into master Apr 4, 2026
6 checks passed
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.

2 participants