Skip to content

fix(billing): omit empty product description for Stripe - #1898

Open
RushikeshBhavsar3605 wants to merge 1 commit into
raystack:mainfrom
RushikeshBhavsar3605:fix/stripe-empty-product-description
Open

fix(billing): omit empty product description for Stripe#1898
RushikeshBhavsar3605 wants to merge 1 commit into
raystack:mainfrom
RushikeshBhavsar3605:fix/stripe-empty-product-description

Conversation

@RushikeshBhavsar3605

Copy link
Copy Markdown
Contributor

Summary

Fix product creation failing when the product description is empty.

Changes

  • Omit the Stripe description parameter when the product description is empty.
  • Preserve the existing behavior when a description is provided.
  • Add a regression test covering empty product descriptions.

Test Plan

  • go test ./billing/product
  • Reproduced the issue end-to-end using a Stripe test account.
  • Verified that creating a product with an empty description now succeeds.

Closes #1853

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

@RushikeshBhavsar3605 is attempting to deploy a commit to the Raystack Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a4831c36-9ef5-4d0d-bfce-e55f0872be41

📥 Commits

Reviewing files that changed from the base of the PR and between 3fa7284 and 8ddebeb.

📒 Files selected for processing (1)
  • billing/product/service_test.go

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Product creation now handles empty descriptions correctly.
    • Products without descriptions are sent to the payment provider without an unnecessary description value.
    • Product records remain successfully created and saved when no description is provided.
  • Tests
    • Added coverage for successful product creation, persistence, and payment-provider requests involving empty descriptions.

Walkthrough

Product creation now omits the Stripe description parameter when the description is empty. Tests verify successful persistence and a nil Stripe description parameter.

Changes

Product creation

Layer / File(s) Summary
Stripe description handling
billing/product/service.go, billing/product/service_test.go
Product creation builds reusable Stripe parameters and assigns Description only when non-empty. Tests cover empty-description creation, persistence, and the Stripe request expectation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🔵 Low · up to 8ddeb

The change correctly omits an empty Stripe description, while the regression test name does not match its successful expectation and could cause minor maintenance confusion. The PR is mergeable with explicit owner awareness or a follow-up rename.

Suggested reviewers: rohilsurana

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR omits Stripe description when empty, preserves non-empty behavior, and adds regression coverage; the separate plan-state defect is explicitly outside this PR's scope.
Out of Scope Changes check ✅ Passed All production and test changes directly support preventing Stripe failures for empty product descriptions.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8aa6608a-710c-4afa-8829-01626fb79b52

📥 Commits

Reviewing files that changed from the base of the PR and between 4fb6f25 and 3fa7284.

📒 Files selected for processing (2)
  • billing/product/service.go
  • billing/product/service_test.go

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.

Comment thread billing/product/service_test.go Outdated
setup func() *product.Service
}{
{
name: "should fail to create product with empty description",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Rename the test to describe success.

The case expects successful creation with wantErr: false. Rename it to "should create product with empty description" so the test name matches the behavior under test.

@RushikeshBhavsar3605
RushikeshBhavsar3605 force-pushed the fix/stripe-empty-product-description branch from 3fa7284 to 8ddebeb Compare August 20, 2026 11:13
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.

Plans and products created via the API are broken: invisible to ListPlans and fail on empty description

1 participant