Skip to content

Fix the "Account Number" column to display either the account number or the IBAN #59724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 17, 2025

Conversation

elazzabi
Copy link
Contributor

Changes proposed in this Pull Request:

This pull request enhances the BACS (Direct Bank Transfer) settings page by ensuring that an account identifier is always visible in the list of bank accounts. Previously, if a bank account had an IBAN but no account number, the "Account Details" column would appear empty.

This change modifies the BankAccountsList component to display the IBAN as a fallback if the account_number is not present. This improves the user experience by providing a consistent and informative view of all configured bank accounts.

This PR also includes minor copy changes for better clarity.

Closes WOOPLUG-5006
Closes #59635

How to test the changes in this Pull Request:

  1. Go to WooCommerce > Settings > Payments > Take offline payments > Direct bank transfer and click Manage.
  2. Scroll down and add a new bank account + Add account.
CleanShot 2025-07-17 at 10 00 55@2x
  1. Create a new bank account, providing details for IBAN but leaving Account number empty. Save the account.
CleanShot 2025-07-17 at 10 01 35@2x
  1. Verify: In the bank accounts list, observe that the IBAN is now displayed in the Account Details column for the newly created account.
  2. Add another account, this time filling in the Account number.
CleanShot 2025-07-17 at 10 02 44@2x
  1. Verify: The account number is displayed in the Account Details column.
CleanShot 2025-07-17 at 10 03 05@2x
  1. Save the changes and refresh the page. Make sure the changes persist.

Testing that has already taken place:

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Fix the "Account Number" column in BACS to display either the account number or the IBAN

Changelog Entry Comment

Comment

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jul 17, 2025
@elazzabi elazzabi self-assigned this Jul 17, 2025
@elazzabi elazzabi requested a review from a team July 17, 2025 09:13
Copy link
Contributor

Testing Guidelines

Hi @woocommerce/moltres,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

Copy link
Contributor

coderabbitai bot commented Jul 17, 2025

📝 Walkthrough

Walkthrough

A changelog entry was added for a WooCommerce plugin fix that updates the display logic for bank account details in the BACS payment method. The user interface now shows "Account Details" and displays either the account number or, if absent, the IBAN for each account. No public APIs were changed.

Changes

File(s) Change Summary
plugins/woocommerce/changelog/59724-fix-show-iban-details Added a changelog entry describing a fix for displaying account number or IBAN in BACS payment method
plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx Updated label from "Account Number" to "Account Details" and logic to display account number or IBAN

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AdminUI
    participant BankAccountsList

    User->>AdminUI: View BACS payment method settings
    AdminUI->>BankAccountsList: Request bank account details
    BankAccountsList-->>AdminUI: Provide account number or IBAN for each account
    AdminUI-->>User: Display "Account Details" column with account number or IBAN
Loading

📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 790af63 and 4608c02.

📒 Files selected for processing (1)
  • plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Jul 17, 2025

Size Change: +1.33 kB (+0.02%)

Total Size: 5.86 MB

Filename Size Change
./plugins/woocommerce/client/blocks/build/product-filter-taxonomy.js 6 kB +1.54 kB (+34.54%) 🚨
./plugins/woocommerce/client/blocks/build/woocommerce/add-to-cart-with-options.js 1.79 kB -494 B (-21.6%) 🎉
./plugins/woocommerce/client/blocks/build/woocommerce/mini-cart.js 6.07 kB -273 B (-4.31%)
./plugins/woocommerce/client/blocks/build/woocommerce/product-price.js 9.02 kB -565 B (-5.9%)

compressed-size-action

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: 0

🧹 Nitpick comments (2)
plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx (1)

167-169: Minor: favour nullish-coalescing for clearer intent

Using || may fall back to the IBAN when account_number is 0, which is falsy but still meaningful. Switching to ?? keeps the fallback strictly for null/undefined.

-{ account.account_number || account.iban }
+{ account.account_number ?? account.iban }
plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-bacs.tsx (1)

250-253: Grammar & consistency: replace “Accounts details”

“Accounts details” sounds awkward; singular “Account details” (or “Bank account details”) is more natural and matches other WooCommerce copy.

-title={ __( 'Accounts details', 'woocommerce' ) }
-description={ __( 'Configure your bank accounts details.', 'woocommerce' ) }
+title={ __( 'Account details', 'woocommerce' ) }
+description={ __( 'Configure your bank account details.', 'woocommerce' ) }
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f829b5 and 25b9221.

📒 Files selected for processing (3)
  • plugins/woocommerce/changelog/59724-fix-show-iban-details (1 hunks)
  • plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx (2 hunks)
  • plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-bacs.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{php,js,ts,jsx,tsx}

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/generate-pr-description.mdc:0-0
Timestamp: 2025-06-30T09:26:55.361Z
Learning: Provide clear, step-by-step instructions for how to test the changes in the PR description.
Learnt from: samueljseay
PR: woocommerce/woocommerce#58716
File: plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/iapi-frontend.ts:83-101
Timestamp: 2025-06-17T07:07:53.443Z
Learning: In WooCommerce blocks, when porting existing code patterns that have known issues (like parseInt truncating decimal money values), maintain consistency with existing implementation rather than making isolated fixes. The preference is for systematic refactoring approaches (like broader Dinero adoption) over piecemeal changes.
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#59675
File: .github/workflows/release-bump-as-requirement.yml:48-65
Timestamp: 2025-07-15T15:39:21.815Z
Learning: In WooCommerce core repository, changelog entries for all PRs live in `plugins/woocommerce/changelog/` directory and are processed during releases, not at the repository root level.
Learnt from: prettyboymp
PR: woocommerce/woocommerce#59048
File: .github/workflows/cherry-pick-milestoned-prs.yml:60-83
Timestamp: 2025-06-26T12:45:40.709Z
Learning: WooCommerce uses WordPress versioning conventions where minor versions in X.Y.Z format are constrained to 0-9 (Y cannot exceed 9). This means version increment logic should reset minor to 0 and increment major when minor reaches 9, rather than allowing two-digit minor versions like 9.10 or 9.11.
Learnt from: ralucaStan
PR: woocommerce/woocommerce#58782
File: plugins/woocommerce/client/blocks/assets/js/base/utils/render-frontend.tsx:0-0
Timestamp: 2025-06-16T16:12:12.148Z
Learning: For WooCommerce checkout blocks, lazy loading was removed in favor of direct imports to prevent sequential "popping" effects during component loading. This approach prioritizes user experience over code splitting, with minimal bundle size impact and improved performance (1.7s to 1.1s speed score improvement). The checkout flow benefits from having all components load together rather than incrementally.
Learnt from: opr
PR: woocommerce/woocommerce#0
File: :0-0
Timestamp: 2025-06-20T17:38:16.565Z
Learning: WooCommerce legacy JavaScript files in plugins/woocommerce/client/legacy/js/ must use older JavaScript syntax and cannot use modern features like optional chaining (?.) due to browser compatibility requirements. Explicit null checking with && operators should be used instead.
Learnt from: vladolaru
PR: woocommerce/woocommerce#58784
File: plugins/woocommerce/src/Internal/Admin/Settings/Payments.php:431-439
Timestamp: 2025-06-17T14:19:30.933Z
Learning: In plugins/woocommerce/src/Internal/Admin/Settings/Payments.php, the process_payment_provider_states() method intentionally filters out payment providers that don't have a _suggestion_id. This is by design to only track state changes for gateways from partner extensions, not core WooCommerce gateways or other installed gateways.
Learnt from: Aljullu
PR: woocommerce/woocommerce#59370
File: plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/style.scss:206-233
Timestamp: 2025-07-03T10:08:59.936Z
Learning: WooCommerce uses Autoprefixer in their PostCSS configuration (plugins/woocommerce/client/blocks/postcss.config.js) with WordPress' standard browserslist configuration (@wordpress/browserslist-config) to automatically add vendor prefixes like -webkit-mask-image based on supported browsers, eliminating the need for manual prefix additions.
Learnt from: Aljullu
PR: woocommerce/woocommerce#59370
File: plugins/woocommerce/client/blocks/assets/js/blocks/product-gallery/style.scss:206-233
Timestamp: 2025-07-03T10:08:59.936Z
Learning: WooCommerce uses Autoprefixer in their PostCSS configuration (plugins/woocommerce/client/blocks/postcss.config.js) with WordPress' standard browserslist configuration (@wordpress/browserslist-config) to automatically add vendor prefixes like -webkit-mask-image based on supported browsers, eliminating the need for manual prefix additions.
plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx (1)
Learnt from: vladolaru
PR: woocommerce/woocommerce#58784
File: plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx:43-50
Timestamp: 2025-06-18T07:56:06.961Z
Learning: In plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx, the user vladolaru prefers to keep the current setUpPlugin function signature with optional positional context parameter rather than refactoring to an options object or making context required.
plugins/woocommerce/changelog/59724-fix-show-iban-details (2)
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#59675
File: .github/workflows/release-bump-as-requirement.yml:48-65
Timestamp: 2025-07-15T15:39:21.815Z
Learning: In WooCommerce core repository, changelog entries for all PRs live in `plugins/woocommerce/changelog/` directory and are processed during releases, not at the repository root level.
Learnt from: samueljseay
PR: woocommerce/woocommerce#58716
File: plugins/woocommerce/client/blocks/assets/js/blocks/mini-cart/iapi-frontend.ts:83-101
Timestamp: 2025-06-17T07:07:53.443Z
Learning: In WooCommerce blocks, when porting existing code patterns that have known issues (like parseInt truncating decimal money values), maintain consistency with existing implementation rather than making isolated fixes. The preference is for systematic refactoring approaches (like broader Dinero adoption) over piecemeal changes.
plugins/woocommerce/client/admin/client/settings-payments/offline/settings-payments-bacs.tsx (2)
Learnt from: vladolaru
PR: woocommerce/woocommerce#58784
File: plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx:43-50
Timestamp: 2025-06-18T07:56:06.961Z
Learning: In plugins/woocommerce/client/admin/client/settings-payments/components/other-payment-gateways/other-payment-gateways.tsx, the user vladolaru prefers to keep the current setUpPlugin function signature with optional positional context parameter rather than refactoring to an options object or making context required.
Learnt from: vladolaru
PR: woocommerce/woocommerce#59160
File: plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx:0-0
Timestamp: 2025-06-26T14:56:54.917Z
Learning: In WooCommerce payments onboarding components (like plugins/woocommerce/client/admin/client/settings-payments/onboarding/providers/woopayments/steps/payment-methods-selection/index.tsx), when updating local React state based on API calls, the local state should only be updated after the API call succeeds to prevent inconsistent state if the save operation fails. The pattern is to move setPaymentMethodsState calls inside the .then() callback of the API promise.
🔇 Additional comments (2)
plugins/woocommerce/client/admin/client/settings-payments/components/bank-accounts-list/bank-accounts-list.tsx (1)

145-149: Use translatable strings for the new column header

'Account Details' is hard-coded, while the rest of WooCommerce UI relies on __() for i18n. Drop-in translators will miss this string.

-<div>Account Details</div>
+<div>{ __( 'Account details', 'woocommerce' ) }</div>
plugins/woocommerce/changelog/59724-fix-show-iban-details (1)

1-4: Changelog entry looks good

Clear, concise, and placed in the correct directory.

Copy link
Contributor

github-actions bot commented Jul 17, 2025

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Contributor

@mordeth mordeth left a comment

Choose a reason for hiding this comment

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

@elazzabi I’ve tested both local and JN installations, but the IBAN doesn’t appear under Account Details when the Account Number is missing.

Screenshot 2025-07-17 at 15 27 30

@elazzabi
Copy link
Contributor Author

I think it's due to the code rabbit suggestion. I reverted it

Copy link
Contributor

@mordeth mordeth left a comment

Choose a reason for hiding this comment

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

✅ Code changes are looking good and making sense.
✅ The testing instructions are checking out correctly with the recent changes.

Screenshot 2025-07-17 at 16 20 11

@elazzabi elazzabi merged commit 7948372 into trunk Jul 17, 2025
22 checks passed
@elazzabi elazzabi deleted the fix/show-iban-details branch July 17, 2025 18:51
@github-actions github-actions bot added this to the 10.1.0 milestone Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix the Account Number column to display either the account number or the IBAN
2 participants