shippex v0.6.14 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 section Functions

Link to this function module(carrier)
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(arg0)
cancel_transaction(Shippex.Transaction.t()) :: {atom(), String.t()}
Link to this callback cancel_transaction(arg0, arg1)
cancel_transaction(Shippex.Shipment.t(), String.t()) :: {atom(), String.t()}
Link to this callback create_transaction(arg0, arg1)
create_transaction(Shippex.Shipment.t(), atom() | Shippex.Service.t()) ::
  {atom(), Shippex.Transaction.t() | map()}
Link to this callback fetch_rate(arg0, arg1)
Link to this callback fetch_rates(arg0)
fetch_rates(Shippex.Shipment.t()) :: [{atom(), Shippex.Rate.t()}]