Skip to content

Commit

Permalink
Updates the Endicia USPS tracking code deducing to return the true tr…
Browse files Browse the repository at this point in the history
…acking code (ignores the Endicia prefix).
  • Loading branch information
dsposito committed Feb 27, 2015
1 parent 05e6ca9 commit 390a0a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ private function deduceTrackingCode()
else if (preg_match('/^[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{2}$/', $tracking_code)) {
$carrier_code = 'usps';
}
elseif (preg_match('/^420[0-9]{5}[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{2}$/', $tracking_code)) {
elseif (preg_match('/^420[0-9]{5}([0-9]{4}[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{4}[0-9]{2})$/', $tracking_code, $matches)) {
$this->tracking_code = $matches[1];

$carrier_code = 'usps';
$provider_code = 'endicia';
}
Expand Down

0 comments on commit 390a0a7

Please sign in to comment.