Shippex.Carrier behaviour (shippex v0.14.0) View Source

Defines a behaviour for implementing a new Carrier module. Includes a helper function for fetching the Carrier module.

Link to this section Summary

Functions

Fetches a Carrier module by its atom/string representation.

Link to this section Types

Link to this section Functions

Specs

module(atom() | String.t()) :: module()

Fetches a Carrier module by its atom/string representation.

iex> Carrier.module(:ups)
Carrier.UPS
iex> Carrier.module("UPS")
Carrier.UPS
iex> Carrier.module("ups")
Carrier.UPS

Link to this section Callbacks

Link to this callback

cancel_transaction(arg1)

View Source

Specs

cancel_transaction(Shippex.Transaction.t()) :: {atom(), String.t()}
Link to this callback

cancel_transaction(arg1, arg2)

View Source

Specs

cancel_transaction(Shippex.Shipment.t(), String.t()) :: {atom(), String.t()}
Link to this callback

create_transaction(arg1, arg2)

View Source

Specs

create_transaction(Shippex.Shipment.t(), atom() | Shippex.Service.t()) ::
  {atom(), Shippex.Transaction.t() | map()}

Specs

Specs

fetch_rates(Shippex.Shipment.t()) :: [{atom(), Shippex.Rate.t()}]

Specs

services_country?(ISO.country_code()) :: boolean()

Specs

track_packages(String.t() | [String.t()]) :: {:ok | :error, any()}

Specs

validate_address(Address.t()) :: {:ok, [Address.t()]} | {:error, any()}