shippex v0.4.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

Link to this type t()
t() :: atom

Link to this section Functions

Link to this function module(carrier)
module(atom | String.t) :: module

Fetches a Carrier module by its atom/string representation.

Carrier.module(:ups) # Carrier.UPS
Carrier.module("UPS") # Carrier.UPS
Carrier.module("ups") # Carrier.UPS

Link to this section Callbacks

Link to this callback fetch_label(arg0, arg1)
fetch_label(Shipment.t, Service.t) :: {atom, Label.t}
Link to this callback fetch_rate(arg0, arg1)
fetch_rate(Shipment.t, Service.t) ::
  [{atom, Rate.t}] |
  {atom, Rate.t}
Link to this callback fetch_rates(arg0)
fetch_rates(Shipment.t) :: [{atom, Rate.t}]