Skip to content

Add stripe-sample fixture - #1

Merged
AndresL230 merged 2 commits into
mainfrom
fixture/stripe-sample
May 13, 2026
Merged

Add stripe-sample fixture#1
AndresL230 merged 2 commits into
mainfrom
fixture/stripe-sample

Conversation

@AndresL230

@AndresL230 AndresL230 commented May 13, 2026

Copy link
Copy Markdown
Contributor

Stripe SDK usage from two official Stripe sample repos:

  • stripe-samples/checkout-one-time-payments @ 1103d50 (commit 2026-05-01) — checkout/session flow.
  • stripe-samples/subscription-use-cases @ fb6e9d4 (commit 2026-05-01) — fixed-price subscriptions and usage-based subscriptions/meters.

3 vendored Node server files + 1 hand-added config file (src/config/methods.js) with object-literal strings shaped like SDK method chains ("charges.create", "checkout.sessions.create", etc.) to test A6 false-positive handling. 19 expected endpoints in expected.json (config file deliberately NOT annotated — its detections would be false positives). 0 expected findings (the vendored servers are flat route handlers with no loops over API calls).

Sanity-check scan: scanner detected 17 Stripe call sites and 0 false positives from the config file — A6 currently passes on this fixture. The benchmark will surface several real-but-missed SDK call sites (prices.retrieve, prices.list, invoices.retrieveUpcoming, billing.meters.create, v2.billing.meterEvents.create, prices.create) — those are recall gaps documented in expected.json, not fixture errors.

See stripe-sample/FIXTURE.md.

Summary by CodeRabbit

  • New Features

    • Added Stripe payment checkout sample implementation with session management and webhook handling.
    • Added Stripe fixed-price subscription sample with customer creation, subscription management, and invoice preview.
    • Added Stripe usage-based subscription sample with metering capabilities and meter event tracking.
  • Documentation

    • Added licensing and fixture documentation for Stripe sample implementations.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@AndresL230 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 43 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: c6a21994-3a05-4b76-b3ba-50beae6e6c2f

📥 Commits

Reviewing files that changed from the base of the PR and between 89358f9 and 1b0c4d0.

📒 Files selected for processing (3)
  • stripe-sample/FIXTURE.md
  • stripe-sample/expected.json
  • stripe-sample/src/custom-payment-flow/server.js
📝 Walkthrough

Walkthrough

This PR introduces a complete Stripe sample fixture for benchmarking API detection scanners. It includes documentation, test expectations defining which Stripe methods should be detected across three Express servers, configuration mapping, and implementations of one-time checkout, fixed-price subscription, and usage-based metered subscription flows.

Changes

Stripe Sample Fixture

Layer / File(s) Summary
Fixture Documentation and Licensing
stripe-sample/FIXTURE.md, stripe-sample/LICENSE
Fixture markdown describes upstream sources, vendored files, and license preservation. MIT License text is added.
Fixture Expectations and Configuration
stripe-sample/expected.json, stripe-sample/src/config/methods.js
expected.json defines test expectations across all three servers, listing Stripe methods with must_detect: true for each endpoint. src/config/methods.js exports configuration constants mapping routes to inert method-chain strings and registered operations.
Checkout Server (One-time Payments)
stripe-sample/src/server.js
Express server for Stripe Checkout providing /config and /checkout-session endpoints, creating checkout sessions in payment mode, and handling webhook signature verification for checkout.session.completed events.
Subscription Server (Fixed-price Subscriptions)
stripe-sample/src/subscriptions/server.js
Express server for managing fixed-price subscriptions with endpoints to create customers, create/update/list subscriptions, preview upcoming invoices, and handle webhook events including payment method updates on invoice completion.
Usage-based Server
stripe-sample/src/usage-based/server.js
Express server for metered usage-based subscriptions with endpoints to create customers, billing meters, meter events, metered prices, and subscriptions, plus webhook event processing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A fixture springs forth, three servers in dance,
Checkout, subscriptions, and usage-based stance.
With webhooks and meters, the Stripe flows run deep,
Through expected detections our scanners shall keep. 🐰✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@AndresL230
AndresL230 merged commit 2d68ae7 into main May 13, 2026
1 check passed
@AndresL230
AndresL230 deleted the fixture/stripe-sample branch May 13, 2026 07:30
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.

1 participant