MPP.Session.Actions (mpp v0.14.0)

Copy Markdown View Source

Server-side session credential action handlers.

Dispatches on credential.payload.action to open, voucher, top_up, and close. Each handler updates per-channel deposit / voucher / spend balances through MPP.Session.Store.

Summary

Functions

Parse a session payload and apply the matching channel-state handler.

Apply a parsed session payload to the channel store.

Dispatch a session credential payload using fields on the session intent.

Types

opts()

@type opts() :: keyword()

Functions

dispatch(payload, opts \\ [])

@spec dispatch(map(), opts()) :: {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}

Parse a session payload and apply the matching channel-state handler.

handle(payload, opts)

@spec handle(MPP.Session.Payload.t(), opts()) ::
  {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}

Apply a parsed session payload to the channel store.

verify(payload, session)

@spec verify(map(), MPP.Intents.Session.t()) ::
  {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}

Dispatch a session credential payload using fields on the session intent.