You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
637 B
PHP
28 lines
637 B
PHP
<?php
|
|
|
|
class Tracking_USPS_gsbarcode {
|
|
|
|
/**
|
|
*
|
|
* @global type $SETTINGS
|
|
* @param string $code
|
|
* @return \TrackingInfo
|
|
* @throws TrackingException
|
|
*/
|
|
public static function track(string $code): TrackingInfo {
|
|
if (strpos($code, "\x1D") === 0) {
|
|
$code = substr($code, 1);
|
|
}
|
|
$codeparts = explode("\x1D", $code);
|
|
if (count($codeparts) == 1) {
|
|
$realcode = $codeparts[0];
|
|
} else {
|
|
// Has routing portion, let's skip that
|
|
$realcode = $codeparts[1];
|
|
}
|
|
|
|
return Tracking::track($realcode, "usps");
|
|
}
|
|
|
|
}
|