Skip to content

Conversation

@sam-lord
Copy link
Contributor

Temporary change to make sure there's a full QA run of the feature before shipping.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

This pull request introduces a new billing information update flow. It adds a new editBilling action handler and corresponding API method to create Stripe update sessions with configurable success and cancel URLs. The UI component is refactored to use the new action, and the billing section heading is simplified from "Billing info & receipts" to "Billing info." Supporting translation keys are added across all localization files for the new error message and update button label.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Switched back to using card checkout flow' does not match the changeset, which implements a new editBilling action and updates billing UI terminology. Update the title to accurately reflect the primary changes, such as 'Add editBilling action for billing information updates' or 'Refactor billing UI to use new editBilling API endpoint'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description mentions a 'temporary change' and 'QA run' but provides no meaningful information about what the changeset actually implements or modifies. Clarify the description with details about the actual changes: the new editBilling action, API endpoint, UI updates, and the purpose of reverting from a previous implementation.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

Temporary change to make sure there's a full QA run of the feature
before shipping.
@sam-lord sam-lord force-pushed the portal-billing-flag branch from 409688a to ea22ad4 Compare January 28, 2026 16:18
Copy link
Contributor

@lsinger lsinger left a comment

Choose a reason for hiding this comment

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

Compared with #25887 and looks good to me.

Copy link
Contributor

@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: 3

🤖 Fix all issues with AI agents
In `@ghost/i18n/locales/fa/portal.json`:
- Line 85: The fa locale file has an empty value for the key "Failed to update
billing information, please try again" in portal.json; update that key's value
with a Persian translation (e.g. به‌روزرسانی اطلاعات صورتحساب با خطا مواجه شد،
لطفاً دوباره تلاش کنید), making sure to replace the empty string with the
translated text and keep the JSON string quoting/escaping intact.

In `@ghost/i18n/locales/hu/portal.json`:
- Line 85: The Hungarian translation for the key "Failed to update billing
information, please try again" contains a double comma ("Kérjük,, próbáld
újra"); edit the value in portal.json to remove the extra comma so it reads
"Kérjük, próbáld újra" while keeping the rest of the string intact.

In `@ghost/i18n/locales/th/portal.json`:
- Line 85: Add the missing Thai translation for the key "Failed to update
billing information, please try again" in ghost/i18n/locales/th/portal.json by
replacing the empty string value with the provided Thai translation
"ไม่สามารถอัปเดตข้อมูลการเรียกเก็บเงินได้ โปรดลองอีกครั้ง" so the portal key
maps to the localized message.
🧹 Nitpick comments (1)
apps/portal/src/utils/api.js (1)

617-619: Redundant .catch() block.

The .catch(function (err) { throw err; }) pattern simply rethrows the error without any transformation or logging. This is equivalent to not having the catch block at all.

🔧 Suggested simplification
-            }).catch(function (err) {
-                throw err;
-            });
+            });

Note: This pattern also exists in manageBilling (lines 571-573), so you may want to address both for consistency.

"Failed to sign up, please try again": "",
"Failed to update account data": "",
"Failed to update account details": "",
"Failed to update billing information, please try again": "",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Provide a Persian translation for this new error message.

Line 85 is user-facing but currently empty, so the UI will likely fall back to English. Please add a localized value.

💬 Suggested translation
-    "Failed to update billing information, please try again": "",
+    "Failed to update billing information, please try again": "به‌روزرسانی اطلاعات صورت‌حساب ناموفق بود، لطفاً دوباره تلاش کنید",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Failed to update billing information, please try again": "",
"Failed to update billing information, please try again": "به‌روزرسانی اطلاعات صورت‌حساب ناموفق بود، لطفاً دوباره تلاش کنید",
🤖 Prompt for AI Agents
In `@ghost/i18n/locales/fa/portal.json` at line 85, The fa locale file has an
empty value for the key "Failed to update billing information, please try again"
in portal.json; update that key's value with a Persian translation (e.g.
به‌روزرسانی اطلاعات صورتحساب با خطا مواجه شد، لطفاً دوباره تلاش کنید), making
sure to replace the empty string with the translated text and keep the JSON
string quoting/escaping intact.

"Failed to sign up, please try again": "Nem sikerült a regisztráció. Kérjük, próbáld újra",
"Failed to update account data": "Nem sikerült frissíteni a fiókadatokat",
"Failed to update account details": "Nem sikerült frissíteni a fiókadatokat",
"Failed to update billing information, please try again": "Nem sikerült frissíteni a számlázási információkat. Kérjük, próbáld újra",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Typo: Double comma in Hungarian translation.

There's a typographical error with a double comma: Kérjük,, should be Kérjük,.

Proposed fix
-    "Failed to update billing information, please try again": "Nem sikerült frissíteni a számlázási információkat. Kérjük,, próbáld újra",
+    "Failed to update billing information, please try again": "Nem sikerült frissíteni a számlázási információkat. Kérjük, próbáld újra",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Failed to update billing information, please try again": "Nem sikerült frissíteni a számlázási információkat. Kérjük, próbáld újra",
"Failed to update billing information, please try again": "Nem sikerült frissíteni a számlázási információkat. Kérjük, próbáld újra",
🤖 Prompt for AI Agents
In `@ghost/i18n/locales/hu/portal.json` at line 85, The Hungarian translation for
the key "Failed to update billing information, please try again" contains a
double comma ("Kérjük,, próbáld újra"); edit the value in portal.json to remove
the extra comma so it reads "Kérjük, próbáld újra" while keeping the rest of the
string intact.

"Failed to sign up, please try again": "",
"Failed to update account data": "",
"Failed to update account details": "",
"Failed to update billing information, please try again": "",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing Thai translation for user-facing error message.

This new error message has an empty translation, meaning Thai users will see the English text when this error occurs. Consider providing a translation for a consistent localized experience.

Suggested translation:

"Failed to update billing information, please try again": "ไม่สามารถอัปเดตข้อมูลการเรียกเก็บเงินได้ โปรดลองอีกครั้ง"
🤖 Prompt for AI Agents
In `@ghost/i18n/locales/th/portal.json` at line 85, Add the missing Thai
translation for the key "Failed to update billing information, please try again"
in ghost/i18n/locales/th/portal.json by replacing the empty string value with
the provided Thai translation "ไม่สามารถอัปเดตข้อมูลการเรียกเก็บเงินได้
โปรดลองอีกครั้ง" so the portal key maps to the localized message.

@sam-lord sam-lord enabled auto-merge (squash) January 28, 2026 16:32
@sam-lord sam-lord merged commit 0a94c3d into main Jan 28, 2026
32 checks passed
@sam-lord sam-lord deleted the portal-billing-flag branch January 28, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants