You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems the problem is this gem expects DHL eCommerce tracking numbers to start with a 2-letter prefix like "GM", but in my experience they are all-numeric (14 digits).
These are real DHL eCommerce tracking numbers generated between May and July, 2024:
dhl_ecommerce_tracking_numbers = %w[51087693037816 60120172242323 60120174971147]
dhl_ecommerce_tracking_numbers.map do |tracking_code|
t = TrackingNumber.new(tracking_code)
t.valid?
end
=> [false, false, false]
Proposal
DHL eCommerce tracking numbers should pass validation.
Additional info
DHL has many different pages for checking shipment status. For some reason, most of these pages don't recognize DHL eCommerce tracking numbers and none recognize them when they're freshly-generated. It seems eCommerce tracking numbers are not recognized until they're scanned. I've found this endpoint seems to be the most useful: https://www.dhl.com/us-en/home/tracking/tracking-parcel.html
I have not been able to find any information about DHL tracking code format, checksum, etc.
The text was updated successfully, but these errors were encountered:
If you're finding e-commerce numbers that don't fit that, then sounds like there are other cases that haven't been handled. Add your tracking numbers to that "valid" block in the data you pointed to, and then modify the regex to make that that first character group optional (probably just a ? after the inner parentheses would do it) and see if all the tests pass.
Problem
This gem seems to support DHL eCommerce, but DHL eCommerce tracking numbers fail validation.
It seems the problem is this gem expects DHL eCommerce tracking numbers to start with a 2-letter prefix like "GM", but in my experience they are all-numeric (14 digits).
These are real DHL eCommerce tracking numbers generated between May and July, 2024:
Proposal
DHL eCommerce tracking numbers should pass validation.
Additional info
The text was updated successfully, but these errors were encountered: