Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Jul 22, 2025

Part of: WOOMOB-891

Description

Addresses the: 3. The HS tariff number can contain dots, but the app doesn't allow it

  • Allow HS tariff input to contain dots
  • Validates the input similarly to the isHSTariffNumberValid in woocommerce-shipping/client/utils/customs.ts
  • Strips the HS tariff string by deleting non-digit characters before sending customs info

Testing steps

  • Open a completed order with physical items and unfulfilled shipments
  • Navigate to "Create Shipping Labels" flow
  • Set a foreign destination address for a shipment to unlock "Customs" section
  • Navigate to customs form settings
  • Expand the product item customs card
  • Enter a valid HS tariff number.
    • Try the old numeric only number (1234567)
    • Try number with dots (12.34.56.78)
  • Enter an invalid HS tariff number. The red error notice message should appear below the field.
    • Try long numeric number - longer than 12 digits
    • Try incorrect dot format (12.34..56)
  • Enter a correct tariff number containing dots 12.34.56.78 and save customs details
  • Fill in other required shipment details like package weight and select a package to start loading shipping rates.
  • Use Proxyman to check out the /wcshipping/v1/label/rate&_method=post and make sure the request payload contains hs_tariff_number value with no dots, i.e. 12345678

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@RafaelKayumov RafaelKayumov added this to the 22.9 milestone Jul 22, 2025
@RafaelKayumov RafaelKayumov added type: task An internally driven task. feature: shipping labels Related to creating, ordering, or printing shipping labels. labels Jul 22, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 22, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr15933-0ed2f79
Version22.8
Bundle IDcom.automattic.alpha.woocommerce
Commit0ed2f79
Installation URL32lf62n4n02h0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@RafaelKayumov RafaelKayumov marked this pull request as ready for review July 22, 2025 09:00
@itsmeichigo itsmeichigo self-assigned this Jul 23, 2025
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this format.

I see that the pattern allows only 1-2 numbers before a dot, but looks like I can bypass the rule by moving the dot after my number passes the format:

Simulator.Screen.Recording.-.iPhone.16.-.2025-07-23.at.18.44.17.mp4

Also, it would be nice if the error message can clarify the rule for the dot, as can be seen from the case above, the message is not helpful.

Since this is most likely an edge case, I'm pre-approving this PR to unblock it.

@RafaelKayumov RafaelKayumov merged commit 494ef48 into trunk Jul 24, 2025
15 checks passed
@RafaelKayumov RafaelKayumov deleted the WOOMOB-891-handle-dots-in-hs-tariff-number branch July 24, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: shipping labels Related to creating, ordering, or printing shipping labels. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants