shippex v0.8.0 Shippex.Carrier behaviour

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 Functions

Link to this function

module(carrier)

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)

Specs

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

cancel_transaction(arg1, arg2)

Specs

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

create_transaction(arg1, arg2)

Specs

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

fetch_rate(arg1, arg2)

Specs

Link to this callback

fetch_rates(arg1)

Specs

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