Update tracking-numbers to support the latest tracking_number_data, and multiple changes to achieve that.#3
Open
bramp wants to merge 10 commits intojcomo:mainfrom
Open
Update tracking-numbers to support the latest tracking_number_data, and multiple changes to achieve that.#3bramp wants to merge 10 commits intojcomo:mainfrom
bramp wants to merge 10 commits intojcomo:mainfrom
Conversation
… to make this available. For example, S10 provides a table of information for each courier. This is now available via the courier_info property on TrackingNumber. If a additional validator is provided, that is now correctly used, instead of the old behaviour that would fail if the additional information was missing. This matches the behaviour of the upstream ruby library, and makes the library more generous at parsing valid tracking numbers, that we don't have additional information for.
…t. Additionally added two new checksum algorithsm, Luhn, and Mod_37_36. Newer formats, such as DPD, require alphanumeric serial numbers / check digits. The upstream library now supports this, and moves the casting to ints into checksum algorithsm, which I've copied.
…turned, as well as returning a list of possible candidates. This helps in the situation where we may not be able to identify the exact courier from the number, and could possibly use some external data source to make the final determination.
…to expose the check digit (mainly to aid in debugging but could in future be part of the official API for generating tracking numbers).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry this is perhaps too many changes in one pull request, but in brief: