Skip to content

Fix/stripe payments tweaks#217

Open
santipalenque wants to merge 2 commits intomainfrom
fix/stripe-payments-tweaks
Open

Fix/stripe payments tweaks#217
santipalenque wants to merge 2 commits intomainfrom
fix/stripe-payments-tweaks

Conversation

@santipalenque
Copy link
Copy Markdown
Contributor

@santipalenque santipalenque commented Apr 13, 2026

as part of this : https://app.clickup.com/t/86b66n5ku

Summary by CodeRabbit

  • New Features

    • Added support for configurable payment options in the Stripe payment component, enabling enhanced form customization.
    • Improved billing details capture in payment processing to support additional customer information fields.
  • Chores

    • Released version 5.0.9-beta.1.

@santipalenque santipalenque requested a review from smarcet April 13, 2026 19:39
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

Version bump to 5.0.9-beta.1 with enhanced Stripe payment components. Added paymentOptions prop support for flexible PaymentElement configuration and improved billing name handling to prefer full_name field when available.

Changes

Cohort / File(s) Summary
Version Update
package.json
Incremented package version from 5.0.8 to 5.0.9-beta.1
Stripe Payment Configuration
src/components/mui/StripePayment/index.jsx, src/components/mui/StripePayment/stripe-form.jsx
Added paymentOptions prop to both components, forwarded through hierarchy to PaymentElement options. Updated billing details logic to use client.full_name with fallback to constructed name.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • smarcet

Poem

🐰 A version hops forward to beta-one,
New payment options shine in the sun!
Names flow smoother, full and complete,
Stripe forms now dance to a configurable beat! 💳✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is vague and uses non-descriptive language ('tweaks') that doesn't convey the specific nature of the changes made to the Stripe payment implementation. Consider using a more descriptive title like 'Add paymentOptions prop and full_name support to Stripe payment form' that clearly indicates the main functional changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/stripe-payments-tweaks

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/mui/StripePayment/stripe-form.jsx`:
- Line 79: The billing name currently uses client.full_name ||
`${client.first_name} ${client.last_name}` which can produce whitespace-only or
"undefined undefined" values; change this to compute a normalized fullName (trim
strings, fallback per-field only if defined) and only set the billing name
property when the resulting fullName is a non-empty string. Specifically, derive
a variable like fullName = (client.full_name || `${client.first_name || ''}
${client.last_name || ''}`).trim(), then if fullName.length > 0 include name:
fullName in the billing object (otherwise omit the name key); update the
assignment site where client.full_name, client.first_name, and client.last_name
are used.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9dff896e-9f84-4ce3-8b9f-e6dab0748eff

📥 Commits

Reviewing files that changed from the base of the PR and between 7270594 and daa108f.

📒 Files selected for processing (3)
  • package.json
  • src/components/mui/StripePayment/index.jsx
  • src/components/mui/StripePayment/stripe-form.jsx

payment_method_data: {
billing_details: {
name: `${client.first_name} ${client.last_name}`,
name: client.full_name || `${client.first_name} ${client.last_name}`,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid sending blank/placeholder billing names.

Line 79 can still send poor values (e.g., whitespace-only full_name or "undefined undefined"). Normalize first and only include name when non-empty.

Suggested hardening
+    const fallbackName = `${client?.first_name ?? ""} ${client?.last_name ?? ""}`.trim();
+    const billingName = (client?.full_name ?? "").trim() || fallbackName;
+
     const {error, paymentIntent} = await stripe.confirmPayment({
       elements,
       confirmParams: {
         return_url: `${window.location.origin}${redirectUrl}`,
         payment_method_data: {
           billing_details: {
-            name: client.full_name || `${client.first_name} ${client.last_name}`,
+            ...(billingName ? {name: billingName} : {}),
             email: client.email,
             ...buildAddress(client.address)
           }
         }
       },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/mui/StripePayment/stripe-form.jsx` at line 79, The billing
name currently uses client.full_name || `${client.first_name}
${client.last_name}` which can produce whitespace-only or "undefined undefined"
values; change this to compute a normalized fullName (trim strings, fallback
per-field only if defined) and only set the billing name property when the
resulting fullName is a non-empty string. Specifically, derive a variable like
fullName = (client.full_name || `${client.first_name || ''} ${client.last_name
|| ''}`).trim(), then if fullName.length > 0 include name: fullName in the
billing object (otherwise omit the name key); update the assignment site where
client.full_name, client.first_name, and client.last_name are used.

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