Add FedEx regex
This commit is contained in:
parent
7ea940a977
commit
0f5908792c
@ -33,7 +33,7 @@ class Carriers {
|
||||
],
|
||||
[
|
||||
"carrier" => "usps",
|
||||
"pattern" => "/^91[0-9]+$/"
|
||||
"pattern" => "/^91[0-9]{12,}+$/"
|
||||
],
|
||||
[
|
||||
"carrier" => "usps",
|
||||
@ -43,6 +43,14 @@ class Carriers {
|
||||
"carrier" => "usps",
|
||||
"pattern" => "/^420[0-9]{5}[0-9]+$/"
|
||||
],
|
||||
[
|
||||
"carrier" => "fedex",
|
||||
"pattern" => "/^[0-9]{15}$/"
|
||||
],
|
||||
[
|
||||
"carrier" => "fedex",
|
||||
"pattern" => "/^[0-9]{12}$/"
|
||||
],
|
||||
[
|
||||
"carrier" => "ups",
|
||||
"pattern" => "/\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\dT]\d\d\d ?\d\d\d\d ?\d\d\d)\b/"
|
||||
@ -59,10 +67,6 @@ class Carriers {
|
||||
"carrier" => "fedex",
|
||||
"pattern" => "/\b((98\d\d\d\d\d?\d\d\d\d|98\d\d) ?\d\d\d\d ?\d\d\d\d( ?\d\d\d)?)\b/"
|
||||
],
|
||||
[
|
||||
"carrier" => "fedex",
|
||||
"pattern" => "/^[0-9]{15}$/"
|
||||
],
|
||||
[
|
||||
"carrier" => "dhl_express",
|
||||
"pattern" => "/^[0-9]{10}$/"
|
||||
@ -112,7 +116,6 @@ class Carriers {
|
||||
"pattern" => "/^1LS[0-9]+$/"
|
||||
],
|
||||
];
|
||||
|
||||
const CARRIERS = [
|
||||
"usps" => [
|
||||
"code" => "usps",
|
||||
@ -151,7 +154,6 @@ class Carriers {
|
||||
"name" => "Helena Express"
|
||||
]
|
||||
];
|
||||
|
||||
const CARRIER_TRACKING_URLS = [
|
||||
"usps" => "https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1={{number}}",
|
||||
"ups" => "https://wwwapps.ups.com/WebTracking/processInputRequest?tracknum={{number}}",
|
||||
@ -192,12 +194,11 @@ class Carriers {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
public static function getCarrierTrackingUrl($carrier, $code) {
|
||||
if (!empty(Carriers::CARRIER_TRACKING_URLS[$carrier])) {
|
||||
return str_replace("{{number}}", $code, Carriers::CARRIER_TRACKING_URLS[$carrier]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user