Skip to content
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

Error messages for tax / VAT details modal are incorrect for Japan #9144

Open
haszari opened this issue Jul 22, 2024 · 1 comment
Open

Error messages for tax / VAT details modal are incorrect for Japan #9144

haszari opened this issue Jul 22, 2024 · 1 comment
Labels
focus: tax (VAT) documents priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability type: bug The issue is a confirmed bug.

Comments

@haszari
Copy link
Contributor

haszari commented Jul 22, 2024

Describe the bug

The error messages for invalid tax ID mention VAT specifically.

These error messages need to be localised to different countries with different names for "VAT", in particular, Japan. Spun off from:

Note that WooPayments service now returns symbolic error codes, allowing the messages to be localised on client:

To fix this bug, I suggest we map error code to error message in plugin client. However could also fix by returning different error messages from service.

To Reproduce

  1. Onboard / set up a WooPayments account with country JP
  2. Set up tax docs so you have a document to view at Payments > Documents. Fake one up with this CLI command:
    • wp wcpay add_document_for_account [account_id] vat_invoice --mode=test --period_from="2024-04-01 00:00:00" --period_to="2024-04-30 23:59:59"
    • Or can use wp wcpay backfill_merchant_vat_invoices
  3. If you've added VAT id / tax information previously, clear it out so you can see the modal:
  4. Go to Payments > Documents.
  5. Click Download for a tax doc row.
  6. See modal.
  7. Enter a bad corporate number, e.g. abc124, and click Continue
Screenshot 2024-07-22 at 2 06 53 PM
Actual behavior

Error message says bad VAT number.

Expected behavior

Error message should refer to corporate number (as appropriate for country).

While we're here, IMO that error message should be closer to the bad data, i.e. above the Continue button. @rogermattic is that aligned with design principles for error messages/components?

@rogermattic
Copy link

rogermattic commented Jul 30, 2024

Hey @haszari ! Thanks for the ping! Yeah I think the validation message should be right below the input field, so I'd put it above the Continue button.

And of course it should refer to corporate number or whatever that field asks for!

@haszari haszari added the priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: tax (VAT) documents priority: medium The issue/PR is medium priority—non-critical functionality loss, minimal effect on usability type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants