Shippex.Carrier behaviour (shippex v0.17.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
Specs
t() :: atom()
Link to this section Callbacks
Specs
cancel_transaction(Shippex.Transaction.t()) :: {atom(), String.t()}
Specs
cancel_transaction(Shippex.Shipment.t(), String.t()) :: {atom(), String.t()}
Specs
create_transaction(Shippex.Shipment.t(), atom() | Shippex.Service.t()) :: {atom(), Shippex.Transaction.t() | map()}
Specs
fetch_rate(Shippex.Shipment.t(), Shippex.Service.t()) :: [{atom(), Shippex.Rate.t()}] | {atom(), Shippex.Rate.t()}
Specs
fetch_rates(Shippex.Shipment.t()) :: [{atom(), Shippex.Rate.t()}]
Specs
services_country?(ISO.country_code()) :: boolean()
Specs
Specs
validate_address(Address.t()) :: {:ok, [Address.t()]} | {:error, any()}
Link to this section Functions
Specs
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