WooCommerce Code Reference

FedExShippingProvider extends AbstractShippingProvider
in package

FedEx Shipping Provider implementation.

Handles FedEx tracking number detection and validation for all FedEx services.

Table of Contents

$supported_countries  : array<string|int, mixed>
List of countries where FedEx has significant operations.
can_ship_from()  : bool
Check if the shipping provider can ship from a specific country.
can_ship_from_to()  : bool
Checks if FedEx can ship between two countries.
can_ship_to()  : bool
Check if the shipping provider can ship to a specific country.
get_icon()  : string
Gets the path to the provider's icon.
get_key()  : string
Gets the unique provider key.
get_name()  : string
Gets the display name of the provider.
get_shipping_from_countries()  : array<string|int, string>
Gets the list of origin countries supported by FedEx.
get_shipping_to_countries()  : array<string|int, string>
Gets the list of destination countries supported by FedEx.
get_tracking_url()  : string
Generates the tracking URL for a given tracking number.
try_parse_tracking_number()  : array<string|int, mixed>|null
Validates and parses a FedEx tracking number.

Properties

Methods

can_ship_from()

Check if the shipping provider can ship from a specific country.

public can_ship_from(string $country_code) : bool
Parameters
$country_code : string

The country code to check.

Return values
boolTrue if the provider can ship from the country, false otherwise.

can_ship_from_to()

Checks if FedEx can ship between two countries.

public can_ship_from_to(string $shipping_from, string $shipping_to) : bool
Parameters
$shipping_from : string

Origin country code.

$shipping_to : string

Destination country code.

Return values
boolTrue if shipping route is supported.

can_ship_to()

Check if the shipping provider can ship to a specific country.

public can_ship_to(string $country_code) : bool
Parameters
$country_code : string

The country code to check.

Return values
boolTrue if the provider can ship to the country, false otherwise.

get_tracking_url()

Generates the tracking URL for a given tracking number.

public get_tracking_url(string $tracking_number) : string
Parameters
$tracking_number : string

The tracking number to generate URL for.

Return values
stringThe complete tracking URL.

try_parse_tracking_number()

Validates and parses a FedEx tracking number.

public try_parse_tracking_number(string $tracking_number, string $shipping_from, string $shipping_to) : array<string|int, mixed>|null
Parameters
$tracking_number : string

The tracking number to validate.

$shipping_from : string

Origin country code.

$shipping_to : string

Destination country code.

Return values
array<string|int, mixed>|nullArray with tracking URL and score, or null if invalid.