Skip to content

fix: correct Stripe environment variable typo (Stripe_CHANEL_SECRET)#12

Draft
Yuankai619 wants to merge 1 commit into
demofrom
corvo/fix/stripe-channel-secret-typo-0o8tb76efixe1
Draft

fix: correct Stripe environment variable typo (Stripe_CHANEL_SECRET)#12
Yuankai619 wants to merge 1 commit into
demofrom
corvo/fix/stripe-channel-secret-typo-0o8tb76efixe1

Conversation

@Yuankai619

Copy link
Copy Markdown
Member

What does this PR do?

This PR corrects the spelling of the environment variable referenced in the Stripe client initialization and mock key check from `Stripe_CHANEL_SECRET` to the correct `Stripe_CHANNEL_SECRET`.

Why is this change needed?

Link the alert / incident that triggered the investigation:

  • Incident: 0.o8tb76efixe1
  • Alert: Ticket flow error alert(dev)
  • Triggered at: 2026-06-11T06:35:20.786Z
  • Root cause: Typo in Stripe environment variable name where the code referenced `Stripe_CHANEL_SECRET` instead of `Stripe_CHANNEL_SECRET` (which is correctly configured in Cloud Run).

How was this change tested?

  • Manual repro verified the fix locally: verified that all references to `Stripe_CHANEL_SECRET` in `lib/stripe.ts` and `app/api/checkout/payment/route.ts` are corrected.

What should reviewers focus on?

The typo has been corrected in both references across the repository.

Out of scope

N/A

Generated by

🤖 Corvo Agent — investigation traced to commit `fe6b67d` (no clear culprit commit, see logs above).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request corrects a typo in the environment variable name, changing Stripe_CHANEL_SECRET to Stripe_CHANNEL_SECRET in both the checkout payment route and the Stripe utility file. The reviewer recommended adding an explicit guard check for the existence of this environment variable in lib/stripe.ts to avoid potential runtime errors caused by the non-null assertion operator.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/stripe.ts
export function getStripe(): Stripe {
if (!_stripe) {
const stripeSecretKey = process.env.Stripe_CHANEL_SECRET;
const stripeSecretKey = process.env.Stripe_CHANNEL_SECRET;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The environment variable Stripe_CHANNEL_SECRET might be undefined at runtime. Using a non-null assertion (!) on the next line without a guard check can lead to runtime errors that are difficult to debug. It is safer to explicitly check for its existence and throw a descriptive error if it is missing.

Suggested change
const stripeSecretKey = process.env.Stripe_CHANNEL_SECRET;
const stripeSecretKey = process.env.Stripe_CHANNEL_SECRET;
if (!stripeSecretKey) {
throw new Error('Stripe_CHANNEL_SECRET environment variable is missing');
}

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